#include using namespace std; using ll = long long; ll powmod(ll a, ll n, ll m){ ll r = 1; while(n){ if(n & 1) (r *= a) %= m; (a *= a) %= m; n >>= 1; } return r; } int main(){ ll n; cin >> n; cout << powmod(n, 3, 1e9 + 7) << endl; }