#include <bits/stdc++.h>
#define M 1000000000000000000
 
using namespace std;

long long a,b;
 
int main()
{
    srand(time(NULL));
    std::ios_base::sync_with_stdio(false);
    cin>>a>>b;
    if(a<3*b){
        cout<<-1<<endl;
        return 0;
    }
    cout<<b<<" "<<0<<endl;
    if(a%2) cout<<1<<" "<<b<<endl;
    else cout<<0<<" "<<b<<endl;
    a-=a%2+2*b;
    if(a>=2*b-2) cout<<a/2+1<<" "<<a/2-1<<endl;
    if(a<2*b-2 && a>=b) cout<<b<<" "<<a-b<<endl;
    return 0;
}