result = [int(input()) for x in range(3)]
print(pow(result[0], result[1]), pow(result[0], result[1], result[2]), sep='\n'
    )

e39ed27cdb5d4de0a259ddf1ecf8ffb564d1ad8e
<mask token>

<mask token>
print(pow(result[0], result[1]), pow(result[0], result[1], result[2]), sep='\n'
    )

result = [int(input()) for x in range(3)]
print(pow(result[0], result[1]), pow(result[0], result[1], result[2]), sep='\n'
    )
