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

namespace Zadatak_4
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            int N = int.Parse(str[0]);
            int M = int.Parse(str[1]);
            int n = int.Parse(str[2]);
            int[,] a = new int[N,M];
            for (int l = 0; l < n; l++)
            {
                str = Console.ReadLine().Split();
                int x = int.Parse(str[0])-1;
                int y = int.Parse(str[1])-1;
                a[x, y] = 1;
            }
            Random s=new Random();
            int p=s.Next(1, 10);
            Console.WriteLine(p);

        }
    }
}