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

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		long startTime = System.nanoTime();
		int p = 8624;
		BigInteger M = BigInteger.ZERO;
		BigInteger Two = BigInteger.valueOf(2L);
		
		M = M.setBit(p);
		M = M.subtract(BigInteger.ONE); // M = 2^p - 1;
		
		BigInteger S = BigInteger.valueOf(4L);
		
		while(p>2) {
		         S = S.pow(2).subtract(Two).mod(M);
		         p--;        
		}
		// System.out.println(S);
		long endTime = System.nanoTime();
		System.out.println("Took "+(endTime - startTime) + " ns"); 

	}
}