#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    long long n, k, rest;
    scanf("%lld %lld",&n,&k);

    if(3 * k > n)
        printf("%d",-1);
    else{
        if(3 * (2 * k - 2) >= n){
            rest = 3 * (k - 2) - (3 * (2 * k - 2) - n);
            if(rest <= k - 2){
                printf("%lld %lld\n",k, rest);
                printf("%lld %lld\n",k, 0);
                printf("%lld %lld\n",k, 0);
            }else{
                if(rest <= 2 * (k - 2)){
                    printf("%lld %lld\n",k, k - 2);
                    printf("%lld %lld\n",k, rest - (k - 2));
                    printf("%lld %lld\n",k, 0);
                }else{
                    printf("%lld %lld\n",k, k - 2);
                    printf("%lld %lld\n",k, k - 2);
                    printf("%lld %lld\n",k, rest - 2 * (k - 2));
                }
            }
        }else{
            if((n - (3 * (2 * k - 2))) % 2 == 0){
                printf("%lld %lld\n",k, k - 2);
                printf("%lld %lld\n",k, k - 2);
                printf("%lld %lld\n",k + ((n - (3 * (2 * k - 2))) / 2), k - 2 + ((n - (3 * (2 * k - 2))) / 2));
            }else{
                printf("%lld %lld\n",k, k - 2);
                printf("%lld %lld\n",k, k - 3);
                printf("%lld %lld\n",k + ((n - (3 * (2 * k - 2))) / 2) + 1, k - 1 + ((n - (3 * (2 * k - 2))) / 2));
            }
        }
    }


}