program

funct power( level, a, n : int; var result : int; ) void

	funct evenPower( level, a, n : int; var result : int; ) void
		var result1 : int;
		begin
			if n == 0 then
				result = 1;
			else
				power( level + 1, a, n / 2, result1 );
				result = result1 * result1;
			end
		end

	funct oddPower( level, a, n : int; var result : int; ) void
		var result1 : int;
		begin
			if n == 1 then
				result = a;
			else
				power( level + 1, a, n / 2, result1 );
				result = a * result1 * result1;
			end
		end

	begin
		if n / 2 * 2 == n then
			evenPower( level + 1, a, n, result );
		else
			oddPower( level + 1, a, n, result );
		end
	end

var a : int;
var n : int;
var result : int;
begin
	a = 2;
	n = 2;
	power( 0, a, n, result );
	println( result );
end.
