import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Scanner; class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); long MODULO = (long) (1e9 + 7); long N = sc.nextLong() % MODULO; long ans = 1; for (int i = 0; i < 3; ++i) { ans = (ans * N) % MODULO; } System.out.println(ans); } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }