#include using namespace std; 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) { cin >> x; vector a; uint32_t b; for (int i = 0; i < 10000001; i++) { b = generate(); a.push_back(b); } sort(a.begin(), a.end()); printf("%u\n", a[5000000]); return 0; }