using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; if ((c[0] + 4) % 12 != c[1]) WriteLine((c[0] + 4) % 12); else WriteLine((c[1] + 4) % 12); } }