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

namespace BOJE
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s1 = Console.ReadLine().Split();
            int m = int.Parse(s1[0]);
            int n = int.Parse(s1[1]);
            int k = int.Parse(s1[2]);
            int[] a = new int[k];
            int[] b = new int[k];
            for (int i = 0; i < k; i++)
            {
                string[] s2 = Console.ReadLine().Split();
                a[i] = int.Parse(s2[0]);
                b[i] = int.Parse(s2[1]);
            }
            Console.WriteLine(1);
        }
    }
}