Consider the following equation: 

Let's find all integer *z* (*z* &gt; 0), for which this equation is unsolvable in positive integers. The phrase "unsolvable in positive integers" means that there are no such positive integers *x* and *y* (*x*, *y* &gt; 0), for which the given above equation holds.

Let's write out all such *z* in the increasing order: *z*<sub class="lower-index">1</sub>, *z*<sub class="lower-index">2</sub>, *z*<sub class="lower-index">3</sub>, and so on (*z*<sub class="lower-index">*i*</sub> &lt; *z*<sub class="lower-index">*i* + 1</sub>). Your task is: given the number *n*, find the number *z*<sub class="lower-index">*n*</sub>.
The first line contains a single integer *n* (1 ≤ *n* ≤ 40).
while True:
    def Sieve(n): 
        prime = [True for i in range(n+1)] 
        p = 2
        while (p * p <= n): 
            if (prime[p] == True): 
                for i in range(p * p, n+1, p): 
                    prime[i] = False
            p += 1
        return prime
    k=Sieve(10000)

    def checker(x):
        i=3
        l=int(pow(x,0.5))
        if x!=2 and x%2==0:
            return False
        else:
            for i in range(3, l+1, 2):
                if x%i==0:
                    return False
                    break
            else:
                return True
    n=int(input())
    s=0
    m=0
    i=2
    while i in range(2,10000) and s<n:
        if k[i]==True:
            if checker(pow(2,i)-1)==True:
                m=i
                s+=1
        i+=1    
    print(pow(2,m-1,1000000007)-1)
