import java.math.BigInteger;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BigInteger x = new BigInteger("3", 10).pow(247);
		System.out.println(x);
	}
}