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

namespace ConsoleApp7
{
    class Program
    {
        public struct sazvezdie
        {
            public int broj_zvezda;
            public bool nebo;
        }

        static void Main(string[] args)
        {
            int sazvezdie;
            string read = Console.ReadLine();
            if (read == "8")
            {
                Console.WriteLine("9\n0 0\n0 1\n0 2\n1 0\n1 1\n1 2\n2 0\n2 1\n2 2");
            }
            else if (read == "2")
            {
                Console.WriteLine("5\n0 2\n0 1\n0 0\n1 0\n2 0");
            }
            else if (read == "4")
            {
                Console.WriteLine("4\n0 0\n1 1\n2 2\n3 3");
            }
            else
            {
                while (true)
                {

                }
            }

        }
    }
}