#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define si short int
#define vi vector<ll>
#define vii vector<vi>
#define ul unsigned ll

ll x[5]={-1,-1,-1,-1,-1},y[5]={-1,-1,-1,-1,-1};

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll n,a;
    cin>>n>>a;
    if(3*a>=n) cout<<"-1"<<endl;
    else
    {
        x[0]=a;
        x[1]=a;
        y[0]=0;
        y[1]=0;
        n-=2*a;
        if(n%2==0)
        {
            x[2]=n/2+1;
            y[2]=n/2-1;
        }
        else
        {
            if(a%2==0)
            {
                if(n<=a+1) return cout<<"-1", 0;
                else
                {
                    x[2]=0,y[2]=a+1;
                    n-=a+1;
                }
            }
            else
            {
                if(n<=a) return cout<<"-1", 0;
                else
                {
                    x[2]=0,y[2]=a;
                    n-=a;
                }
            }
            ///do ovde smo popunili trecu utakmicu tako da nam N postaje paran
            if(n<a) return cout<<"-1",0;
            else
            {
                x[3]=a,y[3]=0;
                n-=a;
                if(n<=a-2) y[3]+=n,n=0;
                else
                {
                    y[3]=a-2;
                    n-=a-2;
                    if(n%2==0)
                    {
                        x[3]+=n/2;
                        y[3]+=n/2;
                        n=0;
                    }
                    else return cout<<"-1",0;
                }
            }
        }
    }

    ll i=0;
    while(x[i]!=-1 && y[i]!=-1)
    {
        cout<<x[i]<<' '<<y[i]<<endl;
        i++;
    }
    return 0;
}