// AC

#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

int main() {
    vector<int> pos;
    int magic = 5040;
    for (int x = 1; ; x++) {
        long d = 1L * x * x + magic * magic;
        if (sqrt(d) == (int)sqrt(d)) {
            pos.push_back(x);
        }
        if (pos.size() == 100) break;
    }

    int n, k;
    cin >> n >> k;

    if (k == n*(n-1)/2) {
        for (int i = 0; i < n; i++) {
            cout << i << " " << 0 << "\n";
        }
        return 0;
    }

    int count = 1, total = 0;
    while (total + count <= k) {
        total += count;
        count++;
    }

    vector<pair<int,int>> ans;
    ans.push_back({magic, 0});
    int u = n;
    u--;
    for (int i = 0; i < count; i++) {
        if (total < k) {
            ans.push_back({0, pos[i]});
            total++;
        } else {
            ans.push_back({0,1e8+i});
        }
        u--;
    }
    for (int i = 1; i <= u; i++) {
        ans.push_back({i,2e8+i});
    }

    if (ans.size() != n) return 1;
    int c = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i+1; j < n; j++) {
            long xd = ans[i].first - ans[j].first;
            long yd = ans[i].second - ans[j].second;
            long d = xd * xd + yd * yd;
            long s = sqrt(d);
            if (s*s == d) c++;
        }
    }
    if (c != k) return 1;

    for (auto a : ans) {
        cout << a.first << " " << a.second << "\n";
    }
}
