#include using namespace std; typedef long long ll; const int INF = 1<<30; const long long INFLL = 1LL<<60; const int MOD = 998244353; int a, b; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> a >> b; int c = a * a + b * b; int x = 0; int y = 0; if (a >= b){ for (int i = 0; i < c; i++){ cout << x << " " << y << '\n'; x = (x + a) % c; y = (y + b) % c; } x = a; y = 0; for (int i = 0; i < c; i++){ cout << x << " " << y << '\n'; x = (x + a) % c; y = (y + b) % c; } } else{ for (int i = 0; i < c; i++){ cout << x << " " << y << '\n'; x = (x + b) % c; y = (y + a) % c; } x = 0; y = a; for (int i = 0; i < c; i++){ cout << x << " " << y << '\n'; x = (x + b) % c; y = (y + a) % c; } } }