using System;

namespace MyApp // Note: actual namespace depends on the project name.
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            long N = long.Parse(s[0]);
            long M = long.Parse(s[1]);
            long[,] memo = new long[N, M];
            List<long> Nkr = new List<long>();

            List<long> Mkr = new List<long>();

            List<long> resenja = new List<long>();
            List<long> prosliNmax = new List<long>();
            List<long> prosliMmax = new List<long>();

            for (int i = 0; i < N; i++)
            {
                string[] c = Console.ReadLine().Split();              

            }
            Console.WriteLine(0);
           
        }
    }
}