#include <bits/stdc++.h>
using namespace std;
long long n,a,rez1,rez2,b;
int main () {
    cin>>n>>a;
    if(a==n or a*2>=n or n<a){
        cout<<-1<<endl;
        return 0;
    }
    else if(a==2 and (n&1)==0){
        cout<<2<<" "<<0<<endl;
        cout<<2<<" "<<0<<endl;
        b=2*a;
        n-=b;
        b=floor(n/2);
        cout<<b+1<<" "<<b-1<<endl;
        return 0;
    }
    else if(a==2 and (n&1)==1){
        cout<<-1<<endl;
        return 0;
    }
    else if((n&1)==0){
        rez1=a;
        rez2=0;
        cout<<rez1<<" "<<rez2<<endl;
        cout<<rez1<<" "<<rez2<<endl;
        b=2*a;
        n-=b;
        b=floor(n/2);
        cout<<b+1<<" "<<b-1<<endl;
        return 0;
    }
    else if((n&1)==1){
        rez1=a;
        rez2=0;
        cout<<rez1<<" "<<rez2+1<<endl;
        cout<<rez1<<" "<<rez2<<endl;
        b=2*a;
        n-=b;
        b=floor(n/2);
        cout<<b+1<<" "<<b-1<<endl;
        return 0;
    }
    return 0;
}