human
Find 2 ^ ( 2 ^ A ) % B | Function to return 2 ^ ( 2 ^ A ) % B.
Base case , 2 ^ ( 2 ^ 1 ) % B = 4 % B.
Driver code.
Print 2 ^ ( 2 ^ A ) % B"
How can the above be solved in Python?
assistant
#Here is code to find 2 ^ ( 2 ^ A ) % B and the other steps required.
 def F ( A , B ) :
	if ( A == 1 ) :
		return ( 4 % B ) ;
	else :
		temp = F ( A - 1 , B ) ;
		return ( temp * temp ) % B ;
A = 25 ;
B = 50 ;
print ( F ( A , B ) ) ;