#include using namespace std; int main(){ unsigned long long int m; cin >> m; unsigned long long int f = (long long)4294967296; f = f%m; f = (f*f)%m; f = (f * f)%m; cout << f << endl; return 0; }