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

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ulaz = Console.ReadLine().Split();
            Int64 N = Int64.Parse(ulaz[0]);
            Int64 M = Int64.Parse(ulaz[1]);
            Int16 K = Int16.Parse(ulaz[2]);
            Int64[,] A = new Int64[N, M];
            for (Int16 i = 0; i < K; i++)
            {
                var ulaz1 = Console.ReadLine().Split();
                Int64 x = Int64.Parse(ulaz[0]);
                Int64 y = Int64.Parse(ulaz[1]);
            }
            Console.WriteLine("1");
        }
    }
}