#include using namespace std; template< typename T = long long > T pow_mod(T x, T n, T mod) { T ret = 1; while(n > 0) { if(n & 1) ret = 1LL * ret * x % mod; x = 1LL * x * x % mod; n >>= 1; } return ret; } int main() { int N; cin >> N; cout << pow_mod(N, 3, (int) (1e9 + 7)) << endl; }