You are given three integers: , and , respectively. Print two lines.
The first line should print the result of pow(a,b). The second line should print the result of pow(a,b,m).
Input Format
The first line contains , the second line contains , and the third line contains .

Hackerrank mod power problem solution in python

Problem solution in python 2 programming language.

a = int(raw_input())
b = int(raw_input())
m = int(raw_input())
print a**b
print pow(a,b,m)

Problem solution in python 3 programming language.

a = int(input())
b = int(input())
m = int(input())
print a**b
print pow(a,b,m)