56
 1
 46
 63478
 7578
 56056
 78
 66873
 8149
 35708
 81207
 41385
 37317
 74424
 67817
 684
 15
 96992
 38798
 19715
 627
 39509
 45899
 31893
 1515
 33
 95298
 27443
 60879
 99
 34378
 57113
 36655
 63359
 873
 67341
 100000
 42863
 35
 250
 573
 23
 871
 15748
 92763
 9564
 42602
 38
 42237
 70878
 93764
 303

-1
 -1
 4
 -1
 3
 -1
 4
 2
 2
 -1
 6
 15
 -1
 21
 73
 -1
 2
 -1
 76
 -1
 2
 -1
 -1
 3
 2
 2
 4
 2
 2
 2
 -1
 2
 -1
 34
 18
 2
 -1
 -1
 -1
 5
 3
 -1
 -1
 8
 22
 3
 17
 -1
 18
 -1
 -1
 2

#!/usr/bin/python2
#-*- coding: utf-8 -*-

import sys,math

#ret = raw_input()
#ret = ret.split(' ')
#text = raw_input().rstrip()
#znak = sys.stdin.read(1) 
#pole=[[]*n for r in xrange(n)]

N = int(raw_input().rstrip())

pozice = [0,0,0,1]

for i in range(4,50000) : 
    n = 2
    nalezene = 1000000
    while n <= i/n :
        if (i*2 % n == 0) :
            if (i*2/n - n + 1) % 2 == 0 :
                k = (i*2/n - n + 1) / 2

                vyhravajici = False
                for a in range(n) :
                    if pozice[k+n] == 1 :
                        vyhravajici = True
                        break
                if not vyhravajici :
                    if nalezene > n : nalezene = n
                    break
        n += 1
    pozice.append(1 if nalezene < 1000000 else 0)

s = "".join(map(str,pozice))

pozice = "00010100010111010110001011000110000111010011001001010111010101010110001011111111111011010011111011111110010011001111111111101110010111010011111111011010001100000111011011111111011010110111111000011010010101011111101101011010010010110011101000110111010111010111111001111111011100011000111101011011110111010110110111011110101111010111011010111011011011011001010110011100001100111011110111010011110111011111011011101011001010010101111011100101011111011111010110011111010011111011110111111110000001110110101011111111010110001011011100011111011011001110011101010011010101011010111011000001111011110111011011110110011110111110111101111010110101110010111011001101011011011111101110011001011011000111011011001011011101010111010111101010011101011110111111010111001010111111011001100111011011010110101111011011110101100011101000011011111011111101010111111101011010111011011011011111011101001010011011110011011011100110011111010010111011011101010110111001011011111111010001010010101111010111111001111110101100011101111000001011010011010111011101011001001111100010111111101010111111111101011011010100011111110011111011010111011111101110010101111011110111111101001011011111011000000011110110011110010011111011111010011110011111010010110101011010010110011011111110010011011111001110010010111101000101011001001011011010010011010111111001010000101110010111011101000011111011011001111011111101011101001011001111011011111011101000111001010110011011110111101011011111011101111010011111110010000100110010110011011111011011010101101111011111100001101011011111011110011011110011110011011110001101011010111011000011000110110111011000111101111010011101010101110011111101011111101010111110011011111110011011010011011111100001011101011011001111011011010011111011011011101010111101011011000111010011111110001111011001110011101110010111010111010011111011011111110111010011011001110011011011010110001110011001011011110011110110111011110001111111111111011111001110010111101011111110011111100011110010011011101111010110111101111010011001101111110111011101010011000111011011010110001011011111011001101011011111011000001010110111010111110111001000011111010111011010011100001010011111010001101111110101011111011010111001011111010011101001011001011111011111011011101011011010011111101110011100010011011010110111010010001010111001011011011001111010111101101011010101111101001010010110101111011011110111011111001110001001011100101011111111010110100101110010111011000111010110011111110011100101010101001110001101011011110011101010010111011111011011111010100011010011001111111111011101011010111101010111010101101011111011011101111011110111000101110111001001111111011010110011011111011111010111010000101101101110011001111110111011011101011010110111011001111111111101011011001011111011010111111011011011011111101011110001011011101011011110001011011010111011010111100111111101010111101111010111101000001111110011010011010011101110011111011010111001011011011111111010111000110101111111010111111110110101010111011111011101001111010011101011011011100100111001011110110011010101011010110111011110111001001111111010111001111010111101010011011010001111011010010111111011011111111111011011110101111011011101011011011001010101011101010110001100011110110011100001110110111011011000110111010111110111111011111110011001011111101011101111011101011011001010010011001110011110110111101011101101011110111111111011101011110111001011110010011011011101011101001011110011111001101011010100011011010011011111011111111010111001010011111011011111011111011111111110111001100111001011011111011011011111111010110110010111011010001011001011011111001101001110011000111111111110001011010111111001011111110110101111011011110111111010010110101011111101111001111111111010011101111011100101011011011110011101010010110111001011011001111011011010111111001010011101111100010011010011011101011111011010111111101011111011010110101011111110110111101111110110111001111110001011010111011110001011111101101011111111111101010011100011011011100011100110011111110011011001001011010111100011010001010011011010110110111011110111011011110111011111011111011111101011111011100110111101010101111011011010000111101011011000111011101011111001011111111011010101010011110110101110011111010110100110111100001011111011010111111010001101011110010111111011010111011010111101011001100111110011011111001101111110111111011011001110011011111010111101111011000110001101011011110011101011010111011010111011111001011011111011011010110111110110011011011111001011010001101011110101110111001010111110011011111111101110011111011101111011001111100111011111010011101111111111011111001101111111111001111011101011101011111111111101010110011010011011011001011011100110011100101010011111110011000111010110001111011011111011110111010110111110011111111010001001010110001111011011011001001011011111011101011010110011111011110111011110111111111111111111010111001111011001010111011011100111111111011011110010111111011000011110011101100110111011110011111111010010111001010111011110111101011010111011011101111110001101111110101011010011111100111011111100110111101011100111011011110010111011111111011111011011110011001011110100111110111011110110010011100110011101011011011011110011011101101010111011011011101011010111111011011111011010011111011011011111011000011010100111011011111111001101111111110011011011110110001111110111111011100111010111011010111111111011110101010011111011011010101111101111011111111010011011110001010110111110011111011011111111011010001010110010011101101011101111011101101011111001010011111111011110001001010011111011111001111110101001010011101001111111010111111011111000011001111011011110111111011011111101010011110111100101011011111111000010111100111010111010111101000111010111011110111001011111011110011101110111010011100111010111011111111111011011111101011011111110110101011110111001001111110111101011010011110011111111011110111110011011110110011011010110011111011000111011111001110111011110111011110111011111011101101110010001101111111011010011111101010110011101010111011010011001111011111111001111011110010111111011110001111010111110011111011011100101011011011111011110111110101111111010011101111011111111111001101110010111011110011111111001011111010110001010011011111111011001010111101101011010111011110011011111011111011010111101111011011110011101111011111011110011110110110111011011111101001011010111011011111011111011011011011111101110011011100011011011111110011111011010110111010011101110010111011011010101011110110110101111011011100111101011011110001111011011011111011110111111011010111011111011011010010111101001011001111011101011011111000010110101110001111010111111111001011111010111010111110111101111011010101111010011010110001111011110111001111010011110111001110110111101011010111111011001111010010111111011010111001011111001011101011111001101001011111011111111111001110110111001010011111011110111011101001111111010010011011111111110011111110011101001011111111111100110011001101011111011111011111101001001111101011111001111011011101011111011011001110010111011110010010001111100010110101011111100111101011011010111101001111010111001010111101111011111011010000011010111011101010111011111111001111011010101011001011011111101011111101111001011011010111111011011011111101011110111011011101011010110011101011011111011011111000010110111011001111010011111011101101110011010111001011111111010111100111010110001110111110111011110011101101011011010011110011011111010111010001111111101001111011111111011011111011110011101011001101011101111110011010111011010111101110111111110011111001011111111011011111111011111011011101011010011010100011011011011111111010111000111011010100011011111011111001101111111010001011011111111110111101111011011110111011011001111111011110010111011111101011110110111011011111011110111111110011110001010010111110010011101011110111001011101110111101111011111011011010111011111110110111111010011110001101011111111011011010111010011011001000110111011011111111011011111110011111011111011111101011011110110011111011010111111001111010111100111010111110111011011010111001010110111011011111111010101111111010111101011100111011110001110011011111110111100011111101011011010111111111111000110111011111011101001110011101110011111011010011011101010110110111110111110011101101110011010011001011111110111011111010110011010011001011011101011010100111111011010111011011111111101010011001010111111011011111011101111011011100111101011111111111100011011110111101011101111011110011110010101011111000111011101011111011011101001111111111110011010011001000111011110111001011110000111011111011011011011011011101111011011010111101110101010111001110011111111110110011011011101010011100111011111011010011011101011011110111010111011011001101011010110111111110011101011011011010110001001011110011011111011111110101111010100111101101111111110011111010011011001111111011110011111011011110101111111011111110011111001011101111010111111111001010011110101011111011111011110011111100011011011010000101011010111110011100111011011111111011110111101011110011111101011111111110111011010111111110011010111110111101010110110111111111011111111011011011111000001011111010011001011011110101011010111011011111111011000011110011010111111111111110010101011011011011111101010111110101011111001011011111010011111011111011111101011110010110001111001011001110110011111011111001111101011011001101111011111011011111010011111110111110111111100011101111111110111011010111111011111111111101111000111011111111010110101111111111010011101011111010111011011010111101110111010010101001011111101001011000111110001111011110111001101110011011011111111011111101011011111110011011011110110101001111011111011000011110110011101010000111001011010011111001011110110111111111010110111110000011110101111011001010111010111011010111011001011111111101110011111110011111010011110011100010110111011110011100011011101011110111011101011010111011111111010111111110010111110011111001110110001111011111111111001111010111111111111010111111011111001011111011011001110010111010111111011111011110111101001011101110111111111111110101101011011111011001011011111011011011011111101011111010111011111111011101111010011010101111111011010110111101011010111111011011011111011111111001100001111111100111011111011011111111011010011010011111111001101011011011010011111010111011110101110111011101001000111010111001111011011111111111111111110111011111011111111010011010110101111111011010011011110011101101110111001110011001011011100011101011111101111010111101111101011111010101011101011110111011011011001110011011011101101011011111011110101010011100110111101011011010111101010011110111011111111011011111010011111111101010111110101111010011110101111111000101111110111010110001011011010011111011111100110111011111011111111111010110010111101010010111111011011011111011011111001110111110011100110111010011110111001011011101111111100011011010111111111011111111101011001111111010111011111001101010111011011011111011110111111011011101011111111011111101110010111110111100010111011011111111110111111011001110111111001111001010111111011011111011111011000011011111011011110011101110011011011011101001011011111111011101111111110011010101111011011110101111111001011011111011011011011011011101111001010011011011111011011111111111011011100011011001011010111001110111010111011111011111010101111011101110111111011011110110011011100111011011011111010011010010011110101010111101110111111010101010101011011010110111011111001110110110011110111111011111111011101011011011111001110010111100011110111110101111011110110111011110111110110111110011011011111011011111010001001011010101011010011011110001110011111011001011011111110011110011111111101111010110111001001111001011101111011010110001010011001011111101111011110001111011111100011111011001001101101011011111111110011011010011110010111111101111011101111111111011010110111110011110100011111111011000001111011011111001011111000110101101011010100011111110011001011011101101110111010011110011111010111111010111100010010111111001011011111111101111011111001111110101111111010011011111111011011011011011111111001011101000011011111011000011011110111111111110110100111110111110011011011011110101111011000111111010111011111111111011111101111011011001010011111110011110011011011111110001011011110111101001011100110011000011110111101010111000111011110111011111011111110011111101011010001010001100111010111001001011111010101011011011110101011010111011001001111010111110111011001111101111011011011011110011011110001011011010111001110111010111111101111010111001011111010110111001011010110111111011011110001011111111110001011011001110011011011010110110111011011111001111011110010111101011011010111011010011110011100011111111111111011010110111010011111110101111011011101011011111011011111111011011110001011011011111011011011110100101001011010111111111011111010011111010011110001111110010111101111010010111011100111011100101110111011011101100010111111011111011110011011011011010111101110011011111011111110011111101110010111011111000011111110111111001110011001011011111010101101011010111011011011111111011011100111111011101111011110011111111111100101011111011111001011111011010111001111110110001100010001111011101011111111001101111111011011011111110011101101011111010111111111011011101111011011111011010111111110011001011011111001010010111111111110011011010111011011011110111111011010111001110011011111011011011011110101011011111110101111011111111011111010011100111111011100110011000111100100111111110011111111011111011111011011111011101101110100011110001111011011111111000011011111111101111111111111110011111111001011010011011011101001011101101110011011110011011011010110111011011011111011011011111010011101011111101001011111011110101111111011011101100111011010101101010010011111111011111110011111011000101011110011010101101111011111011111111010001110111111110011011111111111001111111001011111011011101101011111001001011100011101010111111110011001001010011011010011111111001100011110110101011011011110111010011011011111011011010101011111011011111001011111011011001011111011101011111110011111101110011111111011010111000101011111010010111111011111011111001111011001111111111010111110101111010111110001101011111111011011011011111101010111010111011001011001001111101011011100101011001111011011101011010111011101011111111111010001010111111101011111101001101111011110011011011011111111011011001111011111111111011001111011111010111101011111110011101010010011111011010101111011111111111101101010011011110011011011111110101111011001011111100111110111101001110000011101100111111110001111011010111001111011111010011111111011110011110111010101011111011110111011101011111110111001110111010111011011010010011110011011011111111011011110101011011111111111011011010011011100011111111101011111100111001101011000101111111011011111011111110011010101101011011111011111111011011011010111110111001101011011011011111111000110011011111111111001110011110110111001011110111001011010110110101111010111011011111111011010101111111011110011110011011011111101011010011111111011010111011011111111111011101011010110101110111110110111101010010110101111011011010011011011011011101000011011010111011111011111001111111011111101001011001111011111011111101111111111101111111101011011110011111011111111111011011001010111101011010111011011111011111101011111110101111010011011111011101011011100011010101110001101011111111111011111111011100001111110011111011111011110101011111011111100000111010011010111010011011010011110111011101111011111010111011011111000111111011011011111101110011111100001111011111011011011010111110111011101110110111101011110101111011011110101101111010001110111111111011011010011011011001111011011011111101111011001111111011000010111111011110110011101001011111111011110110111011111111010111110111101010110111011110101011111011111110010011101110110101110011001110111101001110111111111101101010011011011111011011100011110111011011101001010111111010011110011110011111011000111011010011001111011110011110110101110011101111011100101101111011111011010111101010011110110011010111001110111111011011110101010011110111001110111011010111100011011110111111011011111101011011001111111111110111111001011011011010011111011111111011110010010101101111111001110111001011000111111110011110110001111010011110101011111011111011100111111110111010111011110111010011001001011111111110111001110110010011001011111011111001111111011101011010001010111111101011110111111100001011110110111101100111001110111010111111011011011111111111110111111101100010110100101111011111111111010011110011111111111110101011111011001111101011010001100011111011011101011001111111110101111111111010111111011111111101011011010111001011111101111011111111110101111000011011110111111001001110011001010100010011101111111111101011011010111001110011001011011111011011111111010011011011111111011011010011111011000011011111111011011100010110010110111100111010010101111011110111101010010011100101011011010111101110011110111111111011011110111111011010111101011111011011001101010011111001011000011111011111011011111101011011010111111010001100111111011011111110111011111111110111111111011111001010011011111011110011111011011101011010111111011011011111111101011111111111010010011110011011011010110101110011011111111111111110110101111011011011111011011100110111110111111110111011101011111111111011111101101011011011110111111011011111001101011110111111001111010011111110011100111001101010011110110011011011111001011111111111001111011110111011110011110011111011111011110011001010011010011001011111111001111011111110001110010111111011101011010111011111010111011011111011010101111111110010111100010111110111100111010001110101101011011101011000111010011101101011000011011111011011111111111110110011111111111011110001111010010011011011011111011010111011111111011100011011111001010011011110111000111011011011010111011011101111111011111001110010011101010110111110110101111111111110101010011101110011111111011111111111111111111111110011011101011110110011011011111001001111111101011110111011011111010011101011110010110001010110111111011101111011110100010110011011001101010101101111110010011110011010111000010111101011111101001111110111100101111011000011011010111111100010110011011111111011011101011001010111001111001010011111111011011111111011111011010011111101101010111111101110011100110001110010101101011011111011111010111011100111111001111010011111101101010111111010011110110011100011110011011111111011111111110011001111101110011010101111111111010111001010110011110111110011101111111101011010111101011011001011011110111101010011001010010011111111011111010011001110010010111100101011111011110011011010011110011111010111111111111111111011111010011101011011011111011111001011111001011011100111011111011101110011111011111011011011011111111111110010011110111001111110111001010111010110111100011011110011111111011111101010111100111111100011110111111001010111111101011111000011001101011110110001011110111101001111011010110111101011111001001011111011111101111011011111001001010000111011110010011111111011011011111111000011010100101010011010111011110011001111011101011000111011011110011111111011111001011101111011011101011101000110110001011010010111011111111010111111001011010011001001111010111101011111011101001111010011101110111011111110001101010110110111111011111111100111011011011100011011001110111011010010111011111010011011001101111010110011011011011111111111101010110111011010011111011011110011110011111100000010001010111011110001010111111111111001010111111011001111011110001111011010111010111011110011111111011110101011101111011111011011010110010101011011111101111010011011110101111011000111011110111110010111101111011110101011110011110011111011110011111011010011111000011101110111001111110110111011001011010011011011011011111001011111011111000001111110110111010111010111111011111100001111101110011011011111111111111001111111011101011010010111110001110010011110111011011000110011111011010100111011011001111001010111011111011101111011111111010011011010001101011010111011111010110111011011111011011101001111010110001111110011110011011011111011101011010111011011111011010111001101011010110011101011011111111111011110111101001111011110001011011001111001001111011111111010111011111001010011001011111011011110110101011111010111001011111101111011101111011110101011111101110111100011011110011101011110110111110011000111101100011111111011010111011011011011011011010001011010110100111111011010110011111010101111101010011011101010011110010111011011011001010100001110011111011100111111111011111000011111011101011011110011111111011111001111011110111001011010101100110011011010110101111011011110111011111011110111011110111010111011011011110101101011010011011001111110010101111110010111011111110110111001110111111111001011011111101011010011101101111111011011111001110011110111001001011001111111111010011111011100101110011111011011110000111010011111001111111011011011001001111101110011111110010111011011010101111011010011011110111011011011111111010111001111001010011111110011101111010111101011001011110111111110111001011000001011110011111011111110011101011111010010111010011101011010111001011111111011001110111011010011110001111111110110011111011111111011110111011110101110111011010101110111011111011111110011111101111011111111011110111011110011101011010111001011111011111111101011011011011000111110110101111011010111001111011011110011000111010101111010011110110011111011101111111111011110111111011010011111001101110110110111111010111111011010011011110011110010000000011111111011111001110010010111001001111110111111011110011100101011011001011101111010011010011100011011110101111001010011101111011011111101110111111110101011010111111111011010011111011101110011110111010110100011101000111011111110110011010111011111111011010011111011010111011111011111110001011111011011111110011001111010001111010111111111111010011101111011011111011101111010111001110010101110011100011011011011001011111101011011001110010101101011010101101100110011110111111011010111111010111110101010111111010011011011111011110101001011111010111111010011111101011110001011001101011011101011100011111111011111111111101011001011111111111100011111111011011110011111101011011011111011101011011111101111111111111101111011011111011011111111101001011011000011101011111000101011100111011111001011111010011101110010011111111100011011111111110011110001011011011010111111111111010111101111011110011101101110011111011111111111011000111111011110101001011101111011011111011110101101011111110001000011011111011111010011111001111011011111101101011010110011101011010110111011011100110101001011010011011101010011111111111011010111101111011011111111111111010110001111011100110111100010111111011101011010101110011001101011011001110011111110111011111100101001101011010101110011011101111110101010000101110111010011111000111111011011111010111100001011011001111011111011011010010101111111101111111010110011101001011010111010011011011011111010011011111011011011001011011111011110011101011010000011111001110011110011111010011111111011111111110011011111011100111101110011111011111011101010111101010100111011111101010111101011001111011011011011011110111111110011101001111011001110001101011011110011011011011011101111011001110101111011100111111100110111011101001011011111011110010011110011111010010110111111110110111110000011011111111100111011111001011011011111011111011011111111110011010110111110011010110011101011101110111111011011011011000011110011110011011011110011111011111111011110110011011111101010110110011101011110111011010011011111101110011110110111010111011111111011011011111101111010011010111011110011101001010111011011111111011010110110101011011111001010011110110010111011010101111011010110110011111110110111011011011010111011101011110110011111111000111011011011001011111111011010110001110110011111011011111011111111111011010100011111111111011010011010011101000111110011011011111111001110111111010001111011011011011111111111010101111000101111110111111010111010110101010111011110011011011011110011010011011111001011011010011101001011111110011010111010110111010111011011101101011101110011111010111110011011011010011001111011110111111001011011011111011011111111101011111010111011111101011110111111011111110111110010111000010111010010110101111011110111011110111000111111111011011111001011111001111111111011011111011111111111100010010111011110111101011110101011110111011111011001110011111010001011111111101101011010011111111110011110011110111011110011111111011111011111001101110101101011011111011010011110110001011110011110111110011111111111101111011110101011010100110011000011001001111111011010110001011101110110110101011011110001011010011101011011111010110101001011001011011100111010101111111011110111111011011011110011011111011111101011010111011111111011011111011000111011110011110011101111111111110001101011101111011011000111011000110111011011111111011101011011110011011111100111001111011010111111001111011111111010011011110001111011111101111101011011111000011111011111101111011010110111110111001111101011011010111001111111101111111101001010111001111011111110101111011011110011111111110101111010001000110111111011011111111001111000110011111011011110011111011111010011111011111111001111111011110111101011110101101110011110001101011110101111011111010011111011100001011011001111011010011101111011101100011010111010010001111011011111111000110011110111011011010110101111011111110011100011001111111111010101111111110111100111111011011010111111011010011111001011011011111011110011001101011101101010111001111011111111011101011001011011001011011011001011110011111111101011011110011110011111110111010011011011001111111101111011101110111101111011111011111101111011000110111111111010100011010110011111011011111011111011011011010110110011011101111111110011111111111011101101011101011011101111111101110101111011101011010111011111010111111011011011011111011101111110111101010111010110111111011011100011111011011010011111111010110101100011011111111110101011011101111111011111101011010011110011111111010101011011110010111101101011011011011101010010111011111011010111111101011010101011001111001111011111011010110101011010001100111110111011011101011010001111011110011000110111101011110111011011110111110011111010011111011111011111111101111011011111011000011011111011101011011110111111010111111100111011000011111101111011110101111011100011001111011110110111001010110111011011111110011101011011011111011101110011111111011010001111001110011001111011110010010010111110011101011101111011011011111111011010111001011111011110111010011111100111111011011110001011011111110101011011101111111010111011110101001011011011101010011111011111110100011110011110011111110001101011011100011101011110110010011111000111101011011001111111011101101010001111011001010011111011001100011111111010110001111011110111111100011010110011011011010011011011111010111111101011011101001111111011111011111011011010111011010110110011110011011110011011111011111101010011001110011111011011110111011110011011011111011111000111101011000101111011111000011101111111001111011011111011110111011001011110101011011011111011010011010110101011011011100111010011101011111111010011111001011011101111011111111011111011011110011011111011111100110011010011100011111100111111111011111111011111011111111101110011110111011111101111011101000001111010111111011011010011111111111011000011011011010011001011101011011110111011011000010101110011011111011101111011011101011011010111111111011011111111101011001111011011101111111111011010000011111101010011001001111111010111001111011110110011011111111010111011011110110011001011011111011101010001111001111001111011001110111010110111111011011111011011111110111101101111000011010011101010010001011111011111001111011101111011101010111110101011011111110011011111111110011101011010101001111111011011111011010100001111111110111111001011011011111011001011111111111010111011001101011011010111101010010111110111111011011111011011111111111011100011111000111111011111111111011010111111111101011100101111011010010111011011011111111011111010011101011001001111011011001010111111011011011011110111101111011101111011111000010001011111111110111011101011111001101011111010111111011110111011101011010111011101111010111111000010011110011111011110110101011011111001011111011011110011001011011111011110111101110101110011101111011111110011110001101011110011101011010011110001111110011110001111011011011111110111101010101001011011111001011001001111011111111011101011010011011111111011011111011111101010001101011010011011011001111001011111011001111010111011001111010111001011011111010001111110011111111111011111111111111111101111101011010000110010011111011010001011111000010111111011111111011111011010010011011111111110001101001011010111111111110111001011111111111110111011001101011111011010111000110011010111011101110001110011111011010011101110111110111011000011111011001111110011110001111011011011111101010110110011001111011010111010011101010100111011011110011111111011000001111011011111001101111011011101100111010110111010010110111011010011011011111111111010111101010111100011101011111010110011111011011111111111011111110101011011101111111011001011111100101011100111011111011101011011101011010111111011111110110011101111011011011111011100111000011001011111011011011110111001101111011011111011111011111001110011011011011101111011111001111110110111101111011010111011011111110011101011011011011011111011011111011111010011000011100011011111001110011011111011011110010110101010110111111101011011011110011101010010111001011011111011011101011110111011111110110111111110011100110011101011010111011001111010111101111011011111011010011101010011111110011111001011011001101111111011011110110011010010111101011111011011001011011101111101111010111111001111011010111111101010111111010101111011111101011010001111101000011011110011100111011111111111011000101011011011011010001001110011110111111011000111101111110011111011101110110010000011011010111001111011011101011110011011110101111011011011111001011111111001111111010011011010101010111111011011011111011010011111111101011011011111111001011010011011101011111010111011011100111001110011011011111101010111111011110010001110001110111000101111111011110111101010011110111101101011011111001011111011111011111011101011101000011011101011110111011011101010011111110100011011101101111010011010111111011111001011001111011011111001011111110011011101010011110111110011110001000111011011111111010110010111101010011011111111111011010111101111010001010000111011001110011001011111011111110011011110101011011110111001111011011011011011011001111001111011101110011001111110100111110011111110111001011111011111011010011111001011011101010011111111011110101011010110111011110011111011011101011100100011001011011111111111011100011011111110010110011101111010111001011110011111111101011011110011111011110101011011011001011111111010110011011110111011011011111011111110111011111111101010111011111010101011001011010011010011001110011111011010111001011111011111001101011011110011110110011111011111101010110101011011010111101010111110110110101011111111011001010011111011111010011101001011111001010101111010011111111111010010110011110011110111001100010000111011010111111110011011111000111011011011011100011111111110110011111011000111111111011000111011011110111111001011011110011111111011111101011011011111101001110110010111111110011010011111110011011101111111111111110100011011001011111111111011101011010011111111011101011011010111011010010010111010111001111101000111010011001010111010110100111010110110011101110111110011111011010111111011011111110001001011011101111100111010101101011011010111111011110010110001111001011111110011111011110011101011010111111111010111110101010011011011001111111011111101101111011111111001011110011011111011110100111011011011011011011111111011101110111001111011001010111011011111111111111001101010011111011101011011110011111011011010101111011111011101001010011010101011010101110101111011001110111111011011110010101011010111101111011110110110111111110111101111111111111001010011011110111111010001111001111011011100111101011111111101101011110111011011011001011010101011011111111111110011111001011011010111111011011011111001110011010111101011111101100101111011001011111111111100110111001011001011101111011011110011110111011101011110110011111001011011101111011110011110111011111011010011011001010011111111011110010101111011111101110111000111110111111101011010100011101111011111101000011110111100010010011111111111011011111001111011111111011101111010110001110011111111011101111011111101101110010111101011110110010001101011101110111011111011001000111001011110101111011011001111001011011011111111010111111111101010110110111011111010111001011110011110001101011100011011001011110011001011011001011111011010011111111011101010110001011111000011001111110001110011110011011110101110101101011111110011110101001011011011100001011111110010111111011000110011110111101111011101011010011111011011011101011110111010010101110011011110101010110101111011111010011111001010011111010101100011011010111101011101111101010011110111110001111010111011001010110111011111011011110111010011011101111001111011101011111011010110011010111111011011101010011111111111100110010101111010011111011001010011111001111001111111011101010111111011101011011111101011011010111101111011011011011111011010111100111111111111011111011011110011101001011110111011011010010111110011010101011011011011010111111110011111001011110011101011111111111011101011010111111101001011111110111101011011111010011011100110101001111011101011011111111111111010001111010101011011011100111110101011111001110011010111111001011011111101101111011110001010011111111101101011010101011101011011111011010111101110111011111011111111110011010110101011001011111101110011111110111101101011110101011111111111101000111101110111100011111111011110011010111001011111110111111010011011110101111000111011011101011111100111101011010011111001011110110100110010011111011111011011111101011011001011111110111010010111111010111001011011111011111111111011111110011001111111111101111010011110001001011000100011111111011000101011111111111001011011011011111110010111011101111011011110101001011010101001111010011010001111011111011101011011111010111011111101111111011111110111101011110111111111001011111110111011111011110011100011011011011011011011100011100011110011111111011010111111000101111110101011111001110001111011111011111011011011111101110011011111111110011101101011110011010111101011110111110001111011010111011111111010101001110011011010111100011110111011110011010111111111010100011111111111101110011111011011100101010011011010001101111011010111010011111111011110001110110101101011010101011111111111011010011111010010011111010010110011101110111111001011011100111101001011010110111111011010101001111110011010111100111101110001110010111011101101011111010001001011011111111101101011010101111111110011101001011100110111101011010110101011010011111011010011011011011001011011111110111101001011101111111011011101111111011011001111010011110001011011110011011110011011010101111011110111101001111110010011111011010011001011111010111001011011011101111100110011101111101010110110001111111100110011000011010110110011111101111101000011101110111111111110100101011011100011011111111110101111110011110111011011011010111111001011011110111111111011111001111011011111111100011011101011011011010110101111011010011111010011110011011001111011111001010111010111001101011011110111111110011010111111111011111011001010111111011101011010101111001011111111001111111111011001011011011111101011011111110001101011011011111110011010110111110101001010111011011011001110011010011111101011011011011101100011011111111111011111111101101010010110111100111111110110011011110011111011100001110110111011010101011010101111100101111111011011111010110111011011101111011001101111011111110001110111000110111111100011110111010110011011101111011111111111101011010001111010111011011101011011011111011011111110110111011011011110011101010011111011111011111000101011011110111010111011011010011101111011111100111110001111111111110011101111011010011111011111011010110101101011101100111111101011111101011010010111011100110010011111011111010010111010101011010001111011011110111100011111111111111011010011101101010001111010101111011011011011111010110011100011011110011010011110111111011011011111111011011010110011101010111111111011011001110111111010111100111001010111011011011111011010111011011111000011011011011110111011010011111001001011011111011101110011101111011011111111101110111010110101011010011011111011111001010101101011010010111111110011101101111011010110101111111011010111111011011011011110011011110111011011100001101101111110101001010001111111001101011010111011110111110111001111011101111001111011111010111011101011111000111010001111101001010011111001101010010100001111011111011001000010010110111101011011111111110111010110101111111111111011001111010011001101111010111101011011001101111110111010110101111011011010101111011011110010010011101111011011111111111111011011011111011101111011111001111111110011111101010111111111111011011111101010111101111000000011010111011011010011111001111110001011001101111000111111110011010111111010011110010101111111001110111001111111111111111011011111101011010111111111100011110110011011010111111101100011011011011011011011111101010010111111011101011011100111011010111111011011011011010001101011101101011101011011110111011011011110001111111011110000111110010111111011011111111001111010011110001101011010111111011011100011111011111110011011111110011010001011010101111101011110001111111110011110110101110011101111101111011101111111101011011111111011111011011000011011011101101011010011110101011011010110101101011111110011000011111111101011111010011101011010011110111010011011111101011110011010101101110100110111101011111111011011101000011011101010010111001001111010110001101011011010001101011001011011101010011100011111011010010111000011010101111011011010111111111011011010101011111010111101101110011011101001111011110111100011001111111111111110011011010011111111101101111000110011111011111100101111011111110101111011111011111100011011111111001001011010011010011011101011011111111111001111111101110001111111011111011101011110101011001011110111111110011000110011001111010111101110101001111101111011111101111111111111110101111011000010111101011010110011010111011111101111011010111011001010011010011111011011110101110010001110011101011111111011111011010111111111111010111111010111110101011001111011111001111011010111001010111001110011101011011011011111011011110111010011100010111101011110111101011111111011001011111111101111111011111011001110111011110001111011010101011111111010111111001111010111011011111100111001101101011011101111111001010111000111001010011111111010110111111011111111111101111011111011011010011110011111101010111101101010011111011110111011111011111011001110110010011110111010111011101110101011011111010100011011011110111110111111011001011110111110011001011101101011101111010111011111011010110011001011111011111001010010111001010011011111001101011011110011011111011111011111011111110101111011011110111000110011111001111011011110011110010111010011010111011111101011011101110111110011010011111001011010111001011111011111111101011010101010110011111111001011011010110101110011111110011010111001111101111011110111111010010011111001111101111110001011111101111001001011111101011111011111101100011111011011101101111010111001011110011111101011011011111101111011011110011111011111111101011110001111000011011010110011011010111111101111010001110101111011111110111011001011110011111111011010011001010110111011010011010111101010111111011011101111001101011011110011111100011111011111011111111010011111001011111111111111111011010111111011010101101110111011110101111011011011101111011111111011111011010101001111111100111111101011111111011101111010110101011111011110100011011001111011001010011111011111011110011101011011011101111111011011111011111111101111101101111110110011111010010101001010110011111011101111011111111101011011011011011011011111000001011011101111111111010111001111111000010111111011101001011111011011111111011011111111101100111110111111001010010011011010101010111011001010000111101010011011110011111011011111001111011010110111110111010000111011010011111101000111011011011001011011110101111011011110011111011011111001011011011011011011011001011011111111001011111101111000111110011011011010111101011011101011110011011111001011011010110011110011011101111111011111111001111010011011111111111011101011011110111011001111011101110001111011111011011101011011111110110111111111101011111010000111101001011111001111011101111011101011011110111011011110110111110011010111101101011011111101001110011111101011011011011000011011011001111101011010111101111110001011111110111111111011110111010111011111111110111110111111110101111111110011101001110111001010111110011111110111001111111111001111111010111001101011011010011001011110101101111010101011011111111101110011111011010111110011011001110011001010010111111011111110110011011000001111011011011111101011111110010111101001011001111011101011001111011101011010110111011011111111011111110111101011111010111111111111011110111001110011110110011110001110010100111011011111000001011010110111111111111101001111110111011100110011111011011111111111110010110011110111101101011110111011011101111110001111010011111101110010000101011101111110110001111011000111111011111011110101011111010111111011011001110101011010011001111101011011111010111011011111111001010111101011010111110111011011011110010101101111010111111101001011101011011011111011011101011010100011010010111111011011111011110010101111010111111111100011111000011101111111001111010111111011111010111111101011110101011011001111010111111100011011101101011111011011101101010010111111111111011111001111111010110111001011011111011111111011010111111110101111101010111101011011111010011110011010011111110111111011111110111101011011001111111011101111111011010010111000111111011111001010011010110101000011011101111111111011110111111001110011011011111111011011001011011111101011111101110001111011010101101110010011110111111011111110101110010111001011101111111011101111111011111011001010001111110011111011001101110011011110011111011011110011110011011111101110111111010100111011010110011110010001111111111111010111101111010011100011111111010010111011011010111110100011110101111001011010111111110011010010101011111011110011111110111110001011111010111111010011011011011000011011011101011011111010111011011010110101111011110110101011011110110111101011111011011110011100110011110111011110101111011110011101011111011111111111011011110001101011011101011111011010110011011110111010011011011110110101111110001110101011111101110011111011111111111001010111111011111011110111111101010111110111010011010111111111011000111101010011011110011011111011110101011011010010011100111111110101101011010101111011111011011011011010101101111111111011111101111010010100101001111110111011111011110001111111011110110111011111011101111011111010111111011111001110110111110111110111101111011110011011101011010011110011011011111101011111111101110010001011001000111001111011101010011111101011011111110101110011010100111010011110101111011011110111111110011100110011110011110010101011011011111101111111111000101010110011110001101000011111011111111011110011011001111011001010111111110101101011011100101010111011111111110111101111101011011101001111111011110010101001011011110001111010010110011101111010111001111010111110011001011010110111101011111011011011011110010111111010011110011001111111111011111011110111101011111011110011011111111111001111011100110111101111111111111101011011111001011111101011011100011001111011101011011010011111011000110011011010011101101000111010100111111011111111101011011011111011011111011111001110010110011111101010011110111011010011101101111011001111111110111100100011011111011011110011111011110111111011010101011111111010101101010001011110111000011100111011111011110111101111011111111001011010011100011010011011010001110010011010101001010111011011111011010111011010101011011101011011001110101111111011111111011010110011011111011111111011101010110110101011011011010101001011010111011011010111010011011110111111001011011011111001001111011110111011110110110101111010011011110011111011110101111011101011011001111011111001011110010111001011011010011101010011000001011011111010110001011011000111111011011111000011011010011110001111010101001011111011111011011101111010101011111111011111001101011010111011001111010111111011011010111001111010011100011111001011111101011111010110101110111111111111010011010011101011011000111011101011011111111110011111111011011010011110011001011100111011110011011101101011111110111011111011101110011101111011111001011011001011001011111011110011001011010111111110011110111001011010111111111111111011110101111011111111011111011111111011101010111011001111111001110101100011011011111110010011111001111011011110111011011001110011001011110111111011111110110001111011100111011001001011010101010111001111011001011010110111111110011111101110011001111111110010011100011111010011111011111011101011101111011010111011001111111111011001101011011101010011010010011110011010110011011111110111011010011101111111101011010111011011011001111110101011001101011101011011110011110001111011111001111101110011101111001110101010011110110011010011101011011011010011111011111011011111010011111010110111110011111111001010011111011011111011011111010011111010011101111111011110111110011111111011111011010100111011011110111011111011010110111010011010111100011011111111111111010110111101001010011110101111111011111011101011111100011111111010110101001110010111001010011001111011101010110111011111011101110111101010010101011010111110111011010011001110111110011011110101011011111000011011011001011011010011011100111010001011110111011010011010111101111011111111111011111101011011110011111001011011001101001110111111101001110011011111011010111011011110111111011101001011111110111111111111011111011010011011111101111111101110001111011111100111111111011111011011101011110101011111011101011010110111111001111010011110111110111011110011111011010110101010001110110101010111001111011011010111111101111010111110001001011001110011110011011011011011111010111111111010011101011100011011101111111011010111011011011111011010111111111101111011001011111001010011110010011011011010111011111111010011001100011110111011111001010111100111110011111111111011111111001101011011111011011011000111101000111000110011111011010111011010111110110011111111010101010111110011110001100011111110111111011100011010010001011111111110011100011001111011101011011111011011110101111001110011011101111110111011010011110110111110011110111011101011010111111111111111110111111011011011001100010011010011111011011011111111101100011011111011011110101011010111101101011011111110101111011001110110111011010111111111010011110101101011010001111011111000111101010111011011011010111001101011101111010111101011011111110011001111111100111111011010001111011011111111111011011001111111110001111110111111011100101101110011101110011101011011010011011111111111011100111110111111110111011111011110111010010111011011001110111100011111011101101011011010111110011110110111101111110111001101011110111110111011001111111001010011110001111111111111111100011010101111011111011011001110111010110101111111011011011001110011110101001011011110011011011110111011111111010111011111111100100000111111100110011111111011111001011111011111101111011111101011110111011111011011011101111101111010110100111111111010100111011011011111110011111010011011111110010111001011011111111011111010010001011101010011011011011111101111111010111011011011111110110101111111111100111001011110011100011100011011110001111011010110111110111011110111011011111001001011111111111011011011010000101110110110110001011011110011111101010111111111011011011110110001011011111001111011011110101011111011000101111011011011011101111011110111111011011011111010111111011101001011001111111001111011111011011011011111101111011111111110101010011001111110011111111001110011011010111001011111011011011111011011001011010111100111111010011110101011111011010011101011111111111001011111111001111011010111001011010111110011111011011011001011011111111111101010011111011101010111110111110011011111101001011010101010101010011111001111011111110101111011011111011011011011010001111010011100111011111100111111111010111110011111111000111000101010010100011111010011111011011100010111111110111011110011100111010111001011011011010001111011001111110111001010111101010011111110111111011110110101001011111100111111011101110111101011111111111011111111011001111100011111101101011010110011101111110111101011101010111111011011011010111011111010111101011111101011111111011101110011001111111110011111111110111011011111111101011000111010010111111010010011111101111101111001101011011111011010011011110011101011011101011010010011000101111011011111111111111011011111001011011111101011010110111101111111101010011101101011111101111011100110111111011110011010011111010111001110001011111111111011011100011010110111111001111011011110111101011111011011111011011101001011111111111111111011101011110011110011110001111011111011111111011010110011111011011011011010111010110111001010011111110001011010110101111011011111001111011011111011101001110010111011011101110011001011011011011101111111111101011110001110001111011010111001111011101111101111011011111101010011101110111110111010111111010011011111001100111011110010111011011110111011011111011000101011111110111101011011110100010011111111011111111010111111011010011011000111011011111111101010111011011111011010110111111010111110011011111011111001111011111111011011011100010111111011011100001111011011110001011011011010101011011011100111000011011011101011111100111001010011011011111111111011101001111011010011011111010011010011001011110111011111111001011111011011111011011111111011110101011110111110101101011011110010100111010111101001011010110111111011001011101111011010111111111111010111101101111011100011110011111110001111101011110111011111110100011011011011111101110011010110011011011010111011111011010100001111010111111011101011011010111011011110110011110011011011001101011011111011000111011110001111001110110101101011011101011110011011111001111111010111011101011110111111101011011111101010010011111001001011111110111011011011110011101011010110001101011100110010101011011011101001111000111011000011011"

pozice = s+pozice

if pozice[N] == 0 :
    print "-1"


