#include <iostream>

using namespace std; 

static unsigned long long n, a;

static inline void dobro_resi()
{
	n -= 3*a;
    	unsigned long long dva, tri = 0;
        	bool mozda = false;
            	if (a - 2 >= n)
                		dva = n;
                        	else
                            	{
                                		n -= a - 2;
                                        		dva = a - 2;
                                                		mozda = n & 1;
                                                        		tri = n / 2;
                                                                	}
                                                                    	cout << a + tri << ' ' << dva + tri << '\n' << a << ' ' << (mozda ? '1' : '0') << '\n' << a << " 0";
                                                                        }

                                                                        static inline void veoma_dobro_resi()
                                                                        {
                                                                        	if (n & 1)
                                                                            		cout << -1;
                                                                                    	else
                                                                                        	{
                                                                                            		n -= 6;
                                                                                                    		n /= 2;
                                                                                                            		cout << a + n << ' ' << n << "\n2 0\n2 0";
                                                                                                                    	}
                                                                                                                        }

                                                                                                                        int main()
                                                                                                                        {
                                                                                                                        	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
                                                                                                                            	cin >> n >> a;
                                                                                                                                	if (3*a > n)
                                                                                                                                    		cout << -1;
                                                                                                                                            	else
                                                                                                                                                		if (a == 2)
                                                                                                                                                        			veoma_dobro_resi();
                                                                                                                                                                    		else
                                                                                                                                                                            			dobro_resi();
                                                                                                                                                                                        }