/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	static int exp(int x, int n){
		if(n==0)
			return 1;
		if(n==1)
			return x;
		if(n%2==0)
			return exp(x*x, n/2);
		else
			return x * exp(x*x, (n-1)/2);
	}

	public static void main (String[] args) throws java.lang.Exception
	{
		System.out.println(exp(0,0));
		System.out.println(exp(1,0));
		System.out.println(exp(0,1));
		System.out.println(exp(2,1));
		System.out.println(exp(2,2));
		System.out.println(exp(2,3));
		System.out.println(exp(2,4));
		System.out.println(exp(3,2));
		System.out.println(exp(3,4));
		System.out.println(exp(3,5));
	}
}