using System; using System.Collections.Generic; namespace No702 { public class Program { public static void Main(string[] args) { const int A = 5000001; var seed = uint.Parse(Console.ReadLine()); var xorShift = new XorShift(seed); var list = new List(A + 10); for (var i = 0; i < A; i++) { var gen = xorShift.Generate(); list.Add(gen); } list.Sort(); Console.WriteLine(list[A / 2] - list[A / 2]); } } 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; } } }