#include "bits/stdc++.h" using namespace std; #define pb push_back #define mp make_pair constexpr int INF = 1 << 29; constexpr int MOD = 1000000007; typedef long long ll; typedef unsigned long long ull; constexpr int dx[4] = {1, 0, -1, 0}; constexpr int dy[4] = {0, 1, 0, -1}; uint32_t x = 0, y = 1, z = 2, w = 3; uint32_t generate() { uint32_t t = (x^(x<<11)); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); return w; } int main(void) { ll seed; cin >> seed; x = seed; int n = 10000001; priority_queue Q; for (int i = 0; i < n; i++) { uint32_t a = generate(); Q.push(a); if (Q.size() > (n - 1) / 2 + 1) { Q.pop(); } } cout << Q.top() << endl; return 0; }