a, b = map(int, input().split()) s = str(b ** a) print(s)