using System; using System.Collections.Generic; namespace No702 { public class Program { public static void Main(string[] args) { const int A = 10000001; const uint Min = 2100000000; const uint Max = 2200000000; var seed = uint.Parse(Console.ReadLine()); var xorShift = new XorShift(seed); var list = new List(A + 10); var offset = 0; for (var i = 0; i < A; i++) { var gen = xorShift.Generate(); if (gen < Min) offset++; if (gen < Min || Max < gen) continue; list.Add(gen); } list.Sort(); Console.WriteLine(list[A / 2 - offset]); } } public class XorShift { uint x = 0, y = 1, z = 2, w = 3; public XorShift(uint seed) { x = seed; } public uint Generate() { var t = x ^ (x << 11); x = y; y = z; z = w; w = w ^ (w >> 19) ^ t ^ (t >> 8); return w; } } }