#include #include using namespace std; const int NUM = 10000001; int main() { int64_t seed; cin >> seed; uint32_t a[NUM]; uint32_t x = seed, y = 1, z = 2, w = 3; for (int i = 0; i < NUM; ++i) { uint32_t t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); a[i] = w; } sort(a, a+NUM); cout << a[5000000] << endl; return 0; }