#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define MAXN 100005
typedef long long ll;


using namespace std;
ll n,a;

int main()
{
    scanf("%lld %lld", &n, &a);
    if(a==2){
        if(n&1 || n<6){
            printf("-1");
            return 0;
        }
        printf("2 0\n2 0\n%lld %lld",(n-4)/2+1,(n-4)/2-1);
    }else{
        if(n<a+a+a){
            printf("-1");
            return 0;
        }
        if(n==a+a+a){
            printf("%lld 0\n%lld 0\n%lld 0\n",a,a,a);
            return 0;
        }
        printf("%lld 0\n",a);
        if(n&1){
            printf("%lld 1\n",a);
            n=n-a-a-1;
        }else{
            printf("%lld 0\n",a);
            n=n-a-a;
        }
        if(n>=a+a){
            printf("%lld %lld\n",n/2+1,n/2-1);
        }else{
            printf("%lld %lld\n",a,n-a);
        }
    }
    return 0;
}