p2=[]
p2.append(1)
i=1;
temp=2
while i<=501:
p2.append(temp)
temp=temp<<1
i=i+1
t=int(input())
while(t):
t=t-1
p=int(input())
if(p==0):
print "1"
else:
print (p2[p+1]-1)%1298074214633706835075030044377087
cDI9W10KcDIuYXBwZW5kKDEpCmk9MTsKdGVtcD0yCndoaWxlIGk8PTUwMToKCXAyLmFwcGVuZCh0ZW1wKQoJdGVtcD10ZW1wPDwxCglpPWkrMQp0PWludChpbnB1dCgpKQp3aGlsZSh0KToKCXQ9dC0xCglwPWludChpbnB1dCgpKSAKCWlmKHA9PTApOgoJCXByaW50ICIxIgoJZWxzZToKCQlwcmludCAocDJbcCsxXS0xKSUxMjk4MDc0MjE0NjMzNzA2ODM1MDc1MDMwMDQ0Mzc3MDg3