using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace odbojka
{
    class Program
    {
        static void Main(string[] args)
        {
            var ulazna_linija = Console.ReadLine().Split();
            int v = int.Parse(ulazna_linija[0]);
            int s = int.Parse(ulazna_linija[1]);
            int at=0;
            int bt=0;
            int at1 = 0;
            int bt1 = 0;
            
            if (s - ((3 * v) + 3 * (v - 2)) >= 0)
            {
                at = 3 * v; bt = s - at;
                Console.Write(v); Console.Write(" "); Console.WriteLine(v - 2);
                Console.Write(v); Console.Write(" "); Console.WriteLine(v - 2);
                Console.Write(at-v-v); Console.Write(" "); Console.WriteLine(bt-v-2-v-2);
                
                
            }
            else
                if (s - ((4 * v) + 4 * (v - 2)) >= 0)
                {
                    at = 4 * v; bt = s - at;
                    Console.Write(v); Console.Write(" "); Console.WriteLine(v - 2);
                    Console.Write(v); Console.Write(" "); Console.WriteLine(v - 2);
                    Console.Write(v); Console.Write(" "); Console.WriteLine(v - 2);
                    Console.Write(at - v - v - v); Console.Write(" "); Console.WriteLine(bt - v - 2 - v - 2 - v - 2);
                }else
                    if (s - ((5 * v) + 5 * (v - 2)) >= 0)
                    {
                        at = 5 * v; bt = s - at;
                        Console.Write(v); Console.Write(" "); Console.WriteLine(v - 2);
                        Console.Write(v); Console.Write(" "); Console.WriteLine(v - 2);
                        Console.Write(v); Console.Write(" "); Console.WriteLine(v - 2);
                        Console.Write(v); Console.Write(" "); Console.WriteLine(v - 2);
                        Console.Write(at - v - v - v - v); Console.Write(" "); Console.WriteLine(bt - v - 2 - v - 2 - v - 2 - v - 2);
                    }

           
        }
    }
}