#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

int n, a, ost;
int main() {
    IOS; cin >> n >> a;
    ost = n;
    if((a==2 && n%2==1) || 3*a>n) {cout << -1; return 0;}
    cout << a << ' ' << 0 << endl << a << ' ';
    ost -= 2*a;
    if(n%2==1) {--ost; cout << 1;}
    else cout << 0;
    cout << endl;
    if(2*a-2<ost) cout << ost/2+1 << ' ' << ost/2-1;
    else cout << a << ' ' << ost-a;
    return 0;
}