#include <bits/stdc++.h>

using namespace std;

int main()
{
    unsigned long long int p , a;
    cin >> p >> a;
    if(p % 2 == 0)
        {
            cout << a << " 0" << endl;
            cout << a << " 0" << endl;
            cout << (p / 2) + 1 << " " <<(p / 2) - 1;
        }
    if(p % 2 == 0)
        {
            cout << a << " 0" << endl;
            cout << a << " 1" << endl;
            cout << (p / 2) + 1 << " " <<(p / 2) - 1;
        }
        return 0;
}