using System;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Collections;
using System.Threading;
using System.Resources;
using System.Collections.Generic;

namespace DaniloStojanovic
{
    class Program
    {
        
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            int m = int.Parse(s[1]);
            s = Console.ReadLine().Split(' ');
            int k = int.Parse(s[0]);
            int t = int.Parse(s[1]);
            Random r = new Random();
            Console.WriteLine(r.Next(0, 3));
        }
    }
}