#include #include using namespace std; typedef long long ll; 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; }