// AC

#include <iostream>
#include <vector>

using namespace std;

constexpr int N = 2*2*2 * 3*3 * 5 * 7;
constexpr int M = N*N;
const int K = 6e6;

int main() {
    int n, k;
    cin >> n >> k;

    if (n == 1) {
        cout << "0 0\n";
        return 0;
    }

    vector<int> x;
    for (int i = 1; (int) x.size()+1 < n; ++i) {
        if (M % i == 0) {
            int j = M / i;
            if (i % 2 == 0 && j % 2 == 0) {
                x.push_back((j-i)/2);
            }
        }
    }

    int rem = k;
    for (int i = 0; i < n; ++i) {
        if (rem > i) {
            rem -= i;
            continue;
        }

        cout << "0 " << N << '\n';
        for (int j = 0; j < rem; ++j)
            cout << x[j] << " 0\n";
        int w = x.back();
        for (int j = rem; j < i; ++j)
            cout << ++w << " 0\n";
        w = 0;
        int h = N;
        for (int j = i; j < n-1; ++j) {
            cout << ++w << ' ' << (h += K) << '\n';
        }
        break;
    }

    return 0;
}
