// Subtasks:
// 1: AC
// _: TLE

#include <iostream>
#include <cmath>

using namespace std;

int x[101];
int y[101];

int main() {
    int n, k;
    cin >> n >> k;
    while (true) {
        for (int i = 1; i <= n; i++) {
            x[i] = rand() % 10;
            y[i] = rand() % 10;
        }
        int c = 0;
        bool fail = false;
        for (int a = 1; a <= n; a++) {
            for (int b = a+1; b <= n; b++) {
                if (x[a] == x[b] && y[a] == y[b]) fail = true;
                int xd = (x[a]-x[b])*(x[a]-x[b]);
                int yd = (y[a]-y[b])*(y[a]-y[b]);
                double sq = sqrt(xd + yd);
                if (sq == (int)sq) c++;
            }
        }
        if (c == k && !fail) {
            for (int i = 1; i <= n; i++) {
                cout << x[i] << " " << y[i] << "\n";
            }
            return 0;
        }
    }
}
