using System; using System.Linq; class No526 { static void Main() { var num = Console.ReadLine().Split(' ').Select(x => ulong.Parse(x)).ToArray(); ulong before = 21; ulong current = 34; for (ulong i = 11; i < num[0] + 1; ++i) { var temp = before; before = current; current += temp; } Console.WriteLine(current % num[1]); } }