# your code goes here a,b = [int(x) for x in raw_input().split()]print pow(2,2**a,b)
2 7
2
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!