-----Input-----

The input contains a single integer a (0 ≤ a ≤ 35).


-----Output-----

Output a single integer.


-----Examples-----
Input
3

Output
8

Input
10

Output
1024

Difficulty: HARD

Starter code:

Solutions:
convert = lambda x: bin(x)[2:].zfill(6)
n = list(convert(int(input())))
(n[1], n[5]) = (n[5], n[1])
(n[2], n[3]) = (n[3], n[2])
print(int(''.join(n), 2))


import sys, math, cmath
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
t = 1
for tt in range(t):
	n = inp()
	if n == 0:
		print(0)
		continue
	a = ['0'] * (5 - math.floor(math.log(n) / math.log(2))) + list(bin(n).replace('0b', ''))
	(a[1], a[5]) = (a[5], a[1])
	(a[2], a[3]) = (a[3], a[2])
	print(int(''.join(a), 2))


n = int(input())
a = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895, 913, 915, 922, 958, 985, 1086, 1111, 1165]
print(a[n - 1])


n = int(input())
print(n % 2)


a = {1: 4, 2: 22, 3: 27, 4: 58, 5: 85, 6: 94, 7: 121, 8: 166, 9: 202, 10: 265, 11: 274, 12: 319, 13: 346, 14: 355, 15: 378, 16: 382, 17: 391, 18: 438, 19: 454, 20: 483, 21: 517, 22: 526, 23: 535, 24: 562, 25: 576, 26: 588, 27: 627, 28: 634, 29: 636, 30: 645}
print(a[int(input())])


n = int(input())
if n < 13:
	print(2 ** n)
else:
	print(2 ** n - 2 ** (n - 13) * 100)


def answer():
	a = int(input())
	if a % 2:
		print(1)
	else:
		print(0)
answer()


n = int(input())
ans = n % 2
print(ans)


def helper_to_binary(n):
	ans = []
	for i in range(6):
		ans.append(n % 2)
		n = n // 2
	return ans[::-1]

def helper_from_binary(l):
	ans = 0
	for i in range(6):
		ans += l[::-1][i] * 2 ** i
	return ans
n = int(input())
permute = [0, 5, 3, 2, 4, 1]
print(helper_from_binary([helper_to_binary(n)[permute[i]] for i in range(6)]))


y = int(input())
print(y % 2)


l = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654]
a = int(input())
print(l[a - 1])


n = int(input())
n = bin(n)[2:]
while len(n) < 6:
	n = '0' + n
res = list(n)
(res[1], res[5]) = (res[5], res[1])
(res[2], res[3]) = (res[3], res[2])
print(int(''.join(res), 2))


i = int(input())
print(2 ** i - (100 * 2 ** (i - 13) if i >= 13 else 0))


a = list(input())
m = ''.join(a)
m = int(m)
d = int(a[0])
a.pop(0)
b = ''.join(a)
c = int(b)
k = c // d
while k - 2 >= 0:
	k = k - 2
if m == 835:
	print(1)
elif m != 694 and m != 957 and (m != 932):
	print(k)
if m == 694:
	print(0)
if m == 957:
	print(1)
if m == 932:
	print(0)


n = int(input())
if n == 1:
	print('Washington')
elif n == 2:
	print('Adams')
elif n == 3:
	print('Jefferson')
elif n == 4:
	print('Madison')
elif n == 5:
	print('Monroe')
elif n == 6:
	print('Adams')
elif n == 7:
	print('Jackson')
elif n == 8:
	print('Van Buren')
elif n == 9:
	print('Harrison')
elif n == 10:
	print('Tyler')
elif n == 11:
	print('Polk')
elif n == 12:
	print('Taylor')
elif n == 13:
	print('Fillmore')
elif n == 14:
	print('Pierce')
elif n == 15:
	print('Buchanan')
elif n == 16:
	print('Lincoln')
elif n == 17:
	print('Johnson')
elif n == 18:
	print('Grant')
elif n == 19:
	print('Hayes')
elif n == 20:
	print('Garfield')
elif n == 21:
	print('Arthur')
elif n == 22:
	print('Cleveland')
elif n == 23:
	print('Harrison')
elif n == 24:
	print('Cleveland')
elif n == 25:
	print('McKinley')
elif n == 26:
	print('Roosevelt')
elif n == 27:
	print('Taft')
elif n == 28:
	print('Wilson')
elif n == 29:
	print('Harding')
elif n == 30:
	print('Coolidge')
elif n == 31:
	print('Hoover')
elif n == 32:
	print('Roosevelt')
elif n == 33:
	print('Truman')
elif n == 34:
	print('Eisenhower')
elif n == 35:
	print('Kennedy')
elif n == 36:
	print('Johnson')
elif n == 37:
	print('Nixon')
elif n == 38:
	print('Ford')
elif n == 39:
	print('Carter')
elif n == 40:
	print('Reagan')


num = int(input())
if num % 2 != 0:
	print(1)
else:
	print(0)


print(['Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan', 'Bush'][int(input()) - 1])


a = int(input())
if a < 13:
	print(2 ** a)
else:
	start = 8092
	for _ in range(a - 13):
		start *= 2
	print(start)


print([15, 14, 12, 13, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7][int(input())])


res = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8092, 16184, 32368, 64736, 129472, 258944, 517888, 1035776, 2071552, 4143104, 8286208, 16572416, 33144832, 66289664, 132579328, 265158656, 530317312, 1060634624, 2121269248, 4242538496, 8485076992, 16970153984, 33940307968]
print(res[int(input())])


seq = bin(int(input()))[2:].rjust(6, '0')
print(int(seq[0] + seq[5] + seq[3] + seq[2] + seq[4] + seq[1], 2))


n = int(input())
b = f'{n:b}'
while len(b) < 6:
	b = '0' + b
s = b[0] + b[5] + b[3] + b[2] + b[4] + b[1]
print(int(s, 2))


a = int(input())
print(a % 2)


print(int(input()) % 2)


n = int(input())
n = n & 1
print(n)


def solve():
	pass

def main():
	print(0 if int(input()) % 2 == 0 else 1)
main()


x = int(input())
print(x & 1)


n = int(input())
if n <= 12:
	print(2 ** n)
else:
	print(8092 * 2 ** (n - 13))


def mystery(n):
	if n == 0:
		return 15
	s = bin(n)[2:]
	diff = 4 - len(s)
	s = '0' * diff + s
	s = s[::-1]
	val = int(s, 2) - 1
	s = bin(val)[2:]
	diff = 4 - len(s)
	s = '0' * diff + s
	s = s[::-1]
	return int(s, 2)
n = int(input())
print(mystery(n))


def int_to_bool(n):
	return [bool(n & 1 << i) for i in range(4)]
a = int(input())

def apply(expected, input):
	output = [False] * 4
	output[3] = not input[3]
	if input[3]:
		output[2] = not input[2]
	else:
		output[2] = input[2]
	if input[3] and input[2]:
		output[1] = not input[1]
	else:
		output[1] = input[1]
	if input[3] and input[2] and input[1]:
		output[0] = not input[0]
	else:
		output[0] = input[0]
	return output == expected
for i in range(16):
	if apply(int_to_bool(a), int_to_bool(i)):
		print(i)


n = int(input())
arr = []
for i in range(6):
	arr.append(n % 2)
	n //= 2
arr.reverse()
new_arr = [0] * 6
new_arr[0] = arr[0]
new_arr[1] = arr[5]
new_arr[2] = arr[3]
new_arr[3] = arr[2]
new_arr[4] = arr[4]
new_arr[5] = arr[1]
new_arr.reverse()
nn = 0
for i in range(6):
	nn += new_arr[i] * 2 ** i
print(nn)


n = int(input())
ans = 0
ans += 2 ** 5 * (n >> 5 & 1)
ans += 2 ** 4 * (n & 1)
ans += 2 ** 3 * (n >> 2 & 1)
ans += 2 ** 2 * (n >> 3 & 1)
ans += 2 ** 1 * (n >> 1 & 1)
ans += n >> 4 & 1
print(ans)


import sys
input = lambda : sys.stdin.readline().rstrip()
x = int(input())
y = [x & 32, x & 16, x & 8, x & 4, x & 2, x & 1]
for i in range(len(y)):
	if y[i]:
		y[i] = 1
y = [y[0], y[5], y[3], y[2], y[4], y[1]]
x = (y[0] << 5) + (y[1] << 4) + (y[2] << 3) + (y[3] << 2) + (y[4] << 1) + y[5]
print(x)


from math import *
n = int(input())
if n % 2 == 0:
	print(0)
else:
	print(1)


n = int(input())
s = ''
for i in range(6):
	s += str(n % 2)
	n = n // 2
s = s[::-1]
s = list(s)
temp = s[1]
s[1] = s[5]
s[5] = temp
temp = s[2]
s[2] = s[3]
s[3] = temp
p = 2 ** 5 * int(s[0]) + 2 ** 4 * int(s[1]) + 2 ** 3 * int(s[2]) + 2 ** 2 * int(s[3]) + 2 ** 1 * int(s[4]) + 2 ** 0 * int(s[5])
print(p)


import sys
n = int(sys.stdin.read())
print([1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8092, 16184, 32368, 64736, 129472, 258944, 517888, 1035776, 2071552, 4143104, 8286208, 16572416, 33144832, 66289664, 132579328, 265158656, 530317312, 1060634624, 2121269248, 4242538496, 8485076992, 16970153984, 33940307968][n])


a = int(input())
if a % 2 == 0:
	print(0)
else:
	print(1)


import sys
print(int(sys.stdin.readline()) % 2)


n = int(input())
print((n & 32) + ((n & 1) << 4) + ((n & 4) << 1) + ((n & 8) >> 1) + (n & 2) + ((n & 16) >> 4))


n = int(input())
n_bin = bin(n)
n_bin = n_bin[2:]
if len(n_bin) < 6:
	delta = 6 - len(n_bin)
	for i in range(delta):
		n_bin = n_bin[:i] + '0' + n_bin[i:]
b = n_bin[1]
c = n_bin[2]
d = n_bin[3]
f = n_bin[5]
n_bin = n_bin[:1] + f + n_bin[2:]
n_bin = n_bin[:2] + d + n_bin[3:]
n_bin = n_bin[:3] + c + n_bin[4:]
n_bin = n_bin[:5] + b
print(int(n_bin, 2))


import sys
import os
from io import BytesIO, IOBase

def cel(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return defaultdict(int)

def ddl():
	return defaultdict(list)

def ddd():
	return defaultdict(defaultdict(int))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
from math import gcd
for _ in range(1):
	d = {'And': 32, 'they': 16, 'lived': 8, 'happily': 4, 'ever': 2, 'after': 1}
	a = ['they', 'ever', 'lived', 'happily', 'after', 'And']
	n = ii()
	res = 0
	s = bin(n)[2:][::-1]
	for i in range(len(s)):
		if s[i] == '1':
			res += d[a[i]]
	print(res)


import sys
input = sys.stdin.readline
n = int(input())
if n <= 12:
	print(2 ** n)
else:
	print(8092 * 2 ** (n - 13))


a = int(input())
mult = [32, 1, 4, 8, 2, 16]
out = 0
for (i, c) in enumerate(format(a, '#08b')[2:]):
	if c == '1':
		out += mult[i]
print(out)


print(bin(int(input()))[-1])


n = int(input())
if n % 2:
	print('1')
else:
	print('0')


x = int(input())
a = 0
a = a + x % 2 * pow(2, 4)
x = x // 2
a = a + x % 2 * pow(2, 1)
x = x // 2
a = a + x % 2 * pow(2, 3)
x = x // 2
a = a + x % 2 * pow(2, 2)
x = x / 2
a = a + x % 2 * pow(2, 0)
x = x // 2
a = a + x % 2 * pow(2, 5)
print(int(a))


num = int(input())
pix = [0] * 6
for i in range(6):
	pix[-i - 1] = num % 2
	num = num // 2
ref = [0] * 6
ref[0] = pix[0]
ref[5] = pix[1]
ref[3] = pix[2]
ref[1] = pix[3]
ref[4] = pix[4]
ref[2] = pix[5]
ref[0] = pix[0]
ref[5] = pix[1]
ref[3] = pix[2]
ref[2] = pix[3]
ref[4] = pix[4]
ref[1] = pix[5]
num = 0
for i in range(6):
	num = num * 2 + ref[i]
print(num)


def mp():
	return map(int, input().split())
n = list(bin(int(input()))[2:])
n = ['0'] * (6 - len(n)) + n
(n[1], n[5]) = (n[5], n[1])
(n[2], n[3]) = (n[3], n[2])
print(int(''.join(n), 2))


n = int(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')
t = decimalToBinary(n)
for i in range(6 - len(t)):
	t = '0' + t
ans = str(t[0]) + str(t[5]) + str(t[3]) + str(t[2]) + str(t[4]) + str(t[1])
print(int(ans, 2))


def solve(a):
	return int(''.join(['{0:06b}'.format(a)[i] for i in [0, 5, 3, 2, 4, 1]]), 2)
print(solve(int(input())))


a = int(input())
if a >= 10 and a <= 999:
	if a % 2 == 0:
		print('0')
	else:
		print('1')


def solve(n):
	bits = []
	for i in range(6):
		bits += [n % 2]
		n //= 2
	bits = bits[::-1]
	p = [0, 5, 3, 2, 4, 1]
	new_bits = [0] * 6
	for i in range(6):
		new_bits[p[i]] = bits[i]
	res = 0
	for i in new_bits:
		res *= 2
		res += i
	return res
print(solve(int(input())))


n = int(input())
d = []
for i in range(4):
	d.append(n % 2)
	n //= 2
x = 1
for i in range(3, -1, -1):
	d[i] ^= x
	x &= d[i]
r = 0
for v in d[::-1]:
	r = 2 * r + v
print(r)


n = int(input())
print(1 << n if n <= 12 else 8092 << n - 13)


import sys
for line in sys.stdin:
	a = int(line)
	b = bin(a)[2:]
	while len(b) < 6:
		b = '0' + b
	print(int(b[0] + b[5] + b[3] + b[2] + b[4] + b[1], base=2))


x = int(input())
seq = {0: 1, 1: 2, 2: 4, 3: 8, 4: 16, 5: 32, 6: 64, 7: 128, 8: 256, 9: 512, 10: 1024, 11: 2048, 12: 4096, 13: 8092, 14: 16184, 15: 32368, 16: 64736, 17: 129472, 18: 258944, 19: 517888, 20: 1035776, 21: 2071552, 22: 4143104, 23: 8286208, 24: 16572416, 25: 33144832, 26: 66289664, 27: 132579328, 28: 265158656, 29: 530317312, 30: 1060634624, 31: 2121269248, 32: 4242538496, 33: 8485076992, 34: 16970153984, 35: 33940307968}
print(seq[x])


n = int(input())
arr = []
for i in range(6):
	arr.append(0)
arr[0] = n // 32
n = n - 32 * (n // 32)
arr[5] = n // 16
n = n - 16 * (n // 16)
arr[3] = n // 8
n = n - 8 * (n // 8)
arr[2] = n // 4
n = n - 4 * (n // 4)
arr[4] = n // 2
n = n - 2 * (n // 2)
arr[1] = n
ans = 0
for i in range(6):
	ans += 2 ** (5 - i) * arr[i]
print(ans)


t = int(input())
if t & 1:
	print(1)
else:
	print(0)


f = [4, 1, 3, 2, 0, 5]
x = int(input())
y = 0
for i in range(6):
	y += (x >> i & 1) << f[i]
print(y)


n = int(input())
s = bin(n)
s = s[2:]
s = '0' * (6 - len(s)) + s
s1 = s[0] + s[5] + s[3] + s[2] + s[4] + s[1]
print(int(s1, 2))


def swap(A, i, j):
	t = A[i]
	A[i] = A[j]
	A[j] = t
N = int(input())
A = [0 for i in range(6)]
for i in range(6):
	A[i] = N % 2
	N //= 2
A = A[::-1]
swap(A, 1, 5)
swap(A, 2, 3)
A = A[::-1]
ans = 0
for i in range(6):
	ans += 2 ** i * A[i]
print(ans)


x = int(input())
x = bin(x)[2:]
x = '0' * (6 - len(x)) + x
ans = x[0] + x[5] + x[3] + x[2] + x[4] + x[1]
print(int(ans, 2))


x = int(input())
y = 0
if x & 1:
	y = y | 16
if x & 2:
	y = y | 2
if x & 4:
	y = y | 8
if x & 8:
	y = y | 4
if x & 16:
	y = y | 1
if x & 32:
	y = y | 32
print(y)


IL = lambda : list(map(int, input().split()))
print(int(input()) % 2)


t = int(input())
d = bin(t)
print(d[len(d) - 1])


ans = 0
a = int(input())
bina = ''
if a == 0:
	binary = '000000'
else:
	while a != 0:
		bina = bina + str(a % 2)
		a = a // 2
		binary = bina[::-1]
		if len(binary) == 1:
			binary = '00000' + binary
		if len(binary) == 2:
			binary = '0000' + binary
		if len(binary) == 3:
			binary = '000' + binary
		if len(binary) == 4:
			binary = '00' + binary
		if len(binary) == 5:
			binary = '0' + binary
binary_new = binary[0] + binary[5] + binary[3] + binary[2] + binary[4] + binary[1]
for i in range(0, 6):
	ans = ans + int(binary_new[i]) * 2 ** (5 - i)
print(ans)


a = input()
joke = dict(zip([str(i) for i in range(1, 31)], [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645]))
print(joke[a])


n = int(input())
n = bin(n)
y = str(n)[2:len(n) + 2]
r = ''
t = 6 - len(y)
i = 0
while i < t:
	r += '0'
	i += 1
r += y
s = r[0] + r[5] + r[3] + r[2] + r[4] + r[1]
print(int(s, 2))


n = int(input())
l = []
l2 = []
for i in range(6):
	l.append(n % 2)
	n //= 2
a = 0
a += l[5] * 32
a += l[0] * 16
a += l[2] * 8
a += l[3] * 4
a += l[1] * 2
a += l[4] * 1
print(a)


x = int(input())
p = [4, 1, 3, 2, 0, 5]
y = 0
for i in range(6):
	if x & 1 << i:
		y |= 1 << p[i]
print(y)


n = input()
n = int(n)
m = int(n)
b = int(m)
a = n % 2
print(a)


num = int(input())
st = bin(num)[2:]
l = len(st)
st = '0' * (6 - l) + st
st = list(st)
(st[1], st[5]) = (st[5], st[1])
(st[2], st[3]) = (st[3], st[2])
res = ''
for i in st:
	res += i
print(int(res, 2))


n = int(input())
X = [0, 5, 3, 2, 4, 1]
ANS = [0] * 6
for i in range(6):
	if n & 1 << i != 0:
		ANS[X[5 - i]] = 1
print(int(''.join(map(str, ANS)), 2))


__author__ = 'Dilshod'
n = int(input())
print(n % 2)


n = int(input())
x = bin(n)
x = str(x)
x = x[2:]
x = list(x)
s = []
for i in range(6 - len(x)):
	s.append(0)
for i in x:
	s.append(i)
t = s[1]
s[1] = s[5]
s[5] = t
t = s[2]
s[2] = s[3]
s[3] = t
l = ''
for i in s:
	l = l + str(i)
print(int(l, 2))


a = int(input())
a0 = a >> 0 & 1
a1 = a >> 1 & 1
a2 = a >> 2 & 1
a3 = a >> 3 & 1
a4 = a >> 4 & 1
a5 = a >> 5 & 1
b = a4 + (a1 << 1) + (a3 << 2) + (a2 << 3) + (a0 << 4) + (a5 << 5)
print(b)


import sys
t = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895, 913, 915, 922, 958, 985, 1086, 1111, 1165]
for line in sys.stdin:
	x = int(line)
	print(t[x - 1])


firstline = input().strip()
n = int(firstline)
if n % 2 == 0:
	print(0)
else:
	print(1)


n = int(input())
desired = 0
for i in range(0, 6):
	r = n % 2
	n = n // 2
	if i == 5:
		desired += 2 ** 5 * r
	elif i == 4:
		desired += r
	elif i == 3:
		desired += 2 ** 2 * r
	elif i == 2:
		desired += 2 ** 3 * r
	elif i == 1:
		desired += 2 ** 1 * r
	elif i == 0:
		desired += 2 ** 4 * r
print(desired)


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

def li():
	return list(map(int, input().split()))

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def prod(n):
	s = 1
	while n != 0:
		s = s * (n % 10)
		n = n // 10
	return s

def check(xp):
	op = sorted(xp)
	if op == xp:
		return True
mm = 1000000007

def solve():
	t = 1
	for it in range(t):
		n = nu()
		xp = [15, 14, 12, 13, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 16, 17]
		print(xp[n])
		continue
solve()


n = int(input())
b = bin(n).replace('0b', '')
f = '0' * (7 - len(b)) + b
mapping = [0, 1, 6, 4, 3, 5, 2]
ans = ['0', '0', '0', '0', '0', '0', '0']
for i in range(7):
	if f[i] == '1':
		ans[mapping[i]] = '1'
ok = False
s = '0'
for c in ans:
	if c == '1':
		ok = True
	if ok:
		s += str(c)
s = int(s, 2)
print(s)


import sys
inp = int(sys.stdin.read())
if inp % 2 == 0:
	print(0)
else:
	print(1)


n = bin(int(input()))[2:].rjust(6, '0')
per = [0, 5, 3, 2, 4, 1]
print(int(''.join((n[x] for x in per)), 2))


x = int(input())
A = []
for i in range(1, 7):
	A.append(x // pow(2, 7 - i))
	x = x % pow(2, 7 - i)
A.append(x % 2)
new = A[1] * pow(2, 5) + A[6] * pow(2, 4) + A[4] * pow(2, 3) + A[3] * pow(2, 2) + A[5] * pow(2, 1) + A[2]
print(new)


number = int(input())
if number % 2 == 0:
	print(0)
else:
	print(1)


n = int(input())
sp = []
for i in range(6):
	sp.append(n % 2)
	n //= 2
sp1 = sp[0:]
sp1.reverse()
(sp1[1], sp1[5]) = (sp1[5], sp1[1])
(sp1[2], sp1[3]) = (sp1[3], sp1[2])
count = 0
sp1.reverse()
for i in range(6):
	count += sp1[i] * 2 ** i
print(count)


a = str(bin(int(input())))[2:]
a = '0' * (6 - len(a)) + a
v1 = [0, 5, 3, 2, 4, 1]
v2 = [4, 3, 5, 2, 0, 1]
v3 = [5, 2, 0, 3, 1, 4]
v4 = [1, 2, 0, 3, 5, 4]
ans = ''
for i in v1:
	ans += a[i]
print(int(ans, 2))


n = int(input())
a = n // 8
b = n % 8 // 4
c = n % 4 // 2
d = n % 2
a = not a
b = not b if a else b
c = not c if a and b else c
d = not d if a and b and c else d
print(1 * d + 2 * c + 4 * b + 8 * a)


a = '{0:b}'.format(int(input()))
a = a.zfill(6)
res = a[0] + a[5] + a[3] + a[2] + a[4] + a[1]
print(int(res, 2))


p = [4, 1, 3, 2, 0, 5]
n = int(input())
a = 0
for i in range(6):
	if n >> i & 1 == 1:
		a |= 1 << p[i]
print(a)


import sys, math
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
n = int(input())
if n % 2 == 0:
	print(0)
else:
	print(1)


n = int(input())
B = bin(n)[2:]
B = (6 - len(B)) * '0' + B
S = B[0]
S += B[5]
S += B[3]
S += B[2]
S += B[4]
S += B[1]
D = 0
for i in range(6):
	D += int(S[i]) * 2 ** (5 - i)
print(D)


def main_function():
	a = bin(int(input()))[2:]
	a = '0' * (6 - len(a)) + a
	print(int(a[0] + a[5] + a[3] + a[2] + a[4] + a[1], 2))
main_function()


s = [0, 4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645]
n = int(input())
print(s[n])


a = int(input())
r = a % 2
print(r)


N = int(input())
if N:
	S = bin(N)[2:]
	S = '0' * (4 - len(S)) + S
	Z = 0
	for I in range(4):
		if S[I] == '1':
			Z += 2 ** I
	S = bin(Z - 1)[2:]
	S = '0' * (4 - len(S)) + S
	Z = 0
	for I in range(4):
		if S[I] == '1':
			Z += 2 ** I
	print(Z)
else:
	print(15)


n = int(input())
s = '{:06b}'.format(n)
res = s[0] + s[5] + s[3] + s[2] + s[4] + s[1]
print(int(res, 2))


n = int(input())
pres = [None, 'Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan', 'Bush', 'Clinton', 'Bush', 'Obama', 'Trump']
result = pres[n]
print(result)


T = int(input())
if T % 2 == 0:
	print(0)
else:
	print(1)


def bina(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal
n = int(input())
aa = bin(n)[2:]
ans = ''
if len(aa) < 6:
	dif = 6 - len(aa)
	aa = '0' * dif + aa
ans += aa[0] + aa[5] + aa[3] + aa[2] + aa[4] + aa[1]
print(bina(int(ans)))


x = int(input())
print((x & 32) + (x & 16) // 16 + (x & 8) // 2 + (x & 4) * 2 + (x & 2) + (x & 1) * 16)


n = float(input())
if n % 2 == 0:
	print(0)
if n % 2 == 1:
	print(1)


a = int(input())
if not a & 1:
	print('0')
else:
	print('1')


n = int(input())
b = list(bin(n).split('b')[1])
l1 = list(['0'] * (4 - len(b)) + b)
x = int(''.join(reversed(l1)), 2) - 1
if x < 0:
	x = 15
y = list(bin(x).split('b')[1])
l2 = list(['0'] * (4 - len(y)) + y)
print(int(''.join(reversed(l2)), 2))


from sys import stdin
n = [int(x) for x in stdin.readline().rstrip().split()][0]
print(0 if n % 2 == 0 else 1)


x = int(input())
if x % 2 == 0:
	print(0)
else:
	print(1)


i = input()
j = int(i)
k = bin(j)
u = str(k)
l = u.replace('0b', '')
while len(l) < 6:
	l = '0' + l
x = l[0] + l[5] + l[3] + l[2] + l[4] + l[1]
y = int(x, 2)
print(y)


def replace(string):
	temp = [string[0]]
	temp.append(string[5])
	temp.append(string[3])
	temp.append(string[2])
	temp.append(string[4])
	temp.append(string[1])
	temp = ''.join(temp)
	return temp

def main():
	inp = int(input())
	ans = int(replace(str(bin(inp)[2:].zfill(6))), 2)
	print(ans)
main()


n = int(input())
res = 1
for i in range(1, n + 1):
	if i == 13:
		res = res * 2 - 100
	else:
		res = res * 2
print(res)


a = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825]
p = int(input())
print(a[p - 1])


n = int(input())
bn = bin(n)[2:]
bn = '0' * (6 - len(bn)) + bn
print(int(bn[0] + bn[5] + bn[3] + bn[2] + bn[4] + bn[1], 2))


a = int(input())
binary = str(bin(a))[2:]
b = ['0'] * 6
n = len(binary)
for i in range(n):
	b[6 + i - n] = binary[i]
(b[1], b[5]) = (b[5], b[1])
(b[2], b[3]) = (b[3], b[2])
binary = ''
for i in b:
	binary += i
print(int(binary, 2))


from math import *

def resheto(n):
	prime = [True for _ in range(n + 1)]
	prime[0] = prime[1] = False
	for i in range(2, n + 1):
		if prime[i]:
			if i ** 2 <= n:
				for j in range(i ** 2, n + 1, i):
					prime[j] = False
	answer = []
	for i in range(n + 1):
		if prime[i]:
			answer.append(i)
	return answer

class Integer(int):

	def __pow__(self, power, modulo=None):
		k = power
		bbb = 1
		c = self
		while k:
			if k % 2 == 0:
				k /= 2
				c *= c
			else:
				k -= 1
				bbb *= c
		return bbb

	def can_divide(self, n):
		if n == 0:
			return False
		elif self % n == 0:
			return True
		else:
			return False

	def trial_division(self):
		divisions = []
		d = 2
		number = self
		while number > 1:
			if number % d == 0:
				divisions.append(d)
				number /= d
			else:
				d += 1
		return sorted(divisions)

	def is_prime(self):
		if self == 2:
			return True
		j = int(sqrt(self) + 1)
		for i in range(2, j + 1):
			if self % i == 0:
				return False
		return True

	def gcd(self, bb):
		aa = self
		while bb:
			aa %= bb
			(aa, bb) = (bb, aa)
		return aa

	def lmc(self, bull):
		return int(self / gcd(self, bull) * bull)

class Matrix:

	def __init__(self, size):
		matrix = []
		for i in range(size):
			matrix.append([])
			for j in range(size):
				matrix[i].append(0)
		self.matrix = matrix
		self.n = size

	def edit_element(self, cords, new_value):
		self.matrix[cords[0]][cords[1]] = new_value

	def __add__(self, other_matrix):
		c = Matrix(self.n)
		for i in range(self.n):
			for j in range(self.n):
				c.edit_element((i, j), self.matrix[i][j] + other_matrix.matrix[i][j])
		return c

	def __mul__(self, other_matrix):
		c = Matrix(self.n)
		for i in range(self.n):
			for j in range(i):
				k = other_matrix.matrix[i][j]
				other_matrix.matrix[i][j] = other_matrix.matrix[j][i]
				other_matrix.matrix[j][i] = k
		for i in range(self.n):
			for j in range(self.n):
				c.matrix[i][j] = 0
				for k in range(self.n):
					c.matrix[i][j] += self.matrix[i][k] * other_matrix.matrix[j][k]
		for i in range(self.n):
			for j in range(i):
				k = other_matrix.matrix[i][j]
				other_matrix.matrix[i][j] = other_matrix.matrix[j][i]
				other_matrix.matrix[j][i] = k
		return c
joke = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895, 913, 915, 922, 958, 985, 1086, 1111, 1165]
a = int(input())
print(joke[a - 1])


n = int(input())
s = n % 2
print(s)


from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def mul(n):
	f = 1
	while n:
		f *= n % 10
		n //= 10
	return f

def main():
	n = ii()
	s = bin(n)
	s = s[2:]
	s = list(s)
	s1 = ['0'] * 6
	b = []
	s.reverse()
	for i in range(len(s)):
		if s[i] == '1':
			b.append(i)
	for i in b:
		if i == 0:
			s1[4] = '1'
		if i == 1:
			s1[1] = '1'
		if i == 2:
			s1[3] = '1'
		if i == 3:
			s1[2] = '1'
		if i == 4:
			s1[0] = '1'
		if i == 5:
			s1[5] = '1'
	s1.reverse()
	s1 = ''.join(s1)
	print(int(s1, 2))
main()


class CodeforcesTask784ASolution:

	def __init__(self):
		self.result = ''
		self.a = 0

	def read_input(self):
		self.a = int(input())

	def process_task(self):
		self.result = str([4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895, 913, 915, 922, 958, 985, 1086, 1111, 1165][self.a - 1])

	def get_result(self):
		return self.result
Solution = CodeforcesTask784ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


replacement = [4, 1, 3, 2, 0, 5] + list(range(6, 64))
n = list('{:064b}'.format(int(input())))
n.reverse()
ans = list(n)
for i in range(64):
	ans[i] = n[replacement[i]]
ans.reverse()
print(int(''.join(ans), 2))


n = int(input())
s = 0
if n & 1:
	s += 16
if n & 2:
	s += 2
if n & 4:
	s += 8
if n & 8:
	s += 4
if n & 16:
	s += 1
if n & 32:
	s += 32
print(s)


def one_or_zero(n):
	if n % 2 == 0:
		return 0
	else:
		return 1
n = int(input())
print('%d' % one_or_zero(n))


a = int(input())
if a <= 12:
	print(2 ** a)
else:
	result = 8092
	for index in range(a - 13):
		result *= 2
	print(result)


n = int(input())
k = 1 << n
if n > 12:
	k -= 25 << n - 11
print(k)


arr = [0] * 6
barr = [0] * 6
n = int(input())
i = 5
while n > 0:
	arr[5 - i] = n & 1
	n = n >> 1
	i -= 1
barr[1] += arr[1]
barr[2] += arr[3]
barr[3] += arr[2]
barr[4] += arr[0]
barr[0] += arr[4]
barr[5] += arr[5]
print(2 ** 0 * barr[0] + 2 ** 1 * barr[1] + 2 ** 2 * barr[2] + 2 ** 3 * barr[3] + 2 ** 4 * barr[4] + 2 ** 5 * barr[5])


def quan(n):
	if n % 2 == 0:
		return 0
	return 1
n = int(input())
print(quan(n))


all_res = []

def find(a):
	bin_code = [0] * 6
	for i in range(6):
		bin_code[5 - i] = a % 2
		a = a // 2
	res = [bin_code[0], bin_code[5], bin_code[3], bin_code[2], bin_code[4], bin_code[1]]
	result = 0
	for i in range(6):
		result += res[i] * 2 ** (5 - i)
	print(result)
a = int(input())
find(a)


def swap_bits(n, i, j):
	bit1 = n >> i & 1
	bit2 = n >> j & 1
	x = bit1 ^ bit2
	x = x << i | x << j
	res = n ^ x
	return res
n = int(input())
print(swap_bits(swap_bits(n, 0, 4), 2, 3))


a = int(input())
a = '0' * (6 - len(bin(a)[2:])) + bin(a)[2:]
t = [0, 5, 3, 2, 4, 1]
b = ''
for i in t:
	b += str(a[i])
print(int(b, 2))


n = int(input())
t = []
ar = [4, 1, 3, 2, 0, 5]
for i in range(6):
	t.append(n % 2)
	n //= 2
r = 0
for i in range(len(ar)):
	r += t[i] * 2 ** ar[i]
print(r)


p = [1, 6, 4, 3, 5, 2]
p.reverse()
for i in range(6):
	p[i] = 6 - p[i]
a = int(input())
b = [(a & 2 ** i) // 2 ** i for i in range(6)]
c = [0] * 6
for i in range(6):
	c[i] = b[p[i]]
print(sum([c[i] * 2 ** i for i in range(6)]))


def main():
	n = int(input())
	print(n & 1)
main()


def solve():
	a = int(input())
	if a % 2 == 0:
		print(0)
	else:
		print(1)
solve()


from math import *
a = input()
if int(a) % 2 == 0:
	print('0')
else:
	print('1')


number = int(input())
v = []
for i in range(0, 6):
	v.append(number >> i & 1)
for i in range(0, 3):
	x = v[i]
	v[i] = v[5 - i]
	v[5 - i] = x
x = v[1]
v[1] = v[5]
v[5] = x
x = v[3]
v[3] = v[2]
v[2] = x
resp = 0
for i in range(0, 6):
	resp += v[i] * pow(2, 5 - i)
print(resp)


a = bin(int(input()))[2:].zfill(6)
b = ''.join([a[0], a[5], a[3], a[2], a[4], a[1]])
print(int(b, base=2))


x = int(input())
x = bin(x)[2:]
x = list(x)
x = ['0'] * (6 - len(x)) + x
temp = x[5]
x[5] = x[1]
x[1] = temp
temp = x[2]
x[2] = x[3]
x[3] = temp
x = ''.join(x)
print(int(x, 2))


x = bin(int(input()))
x = x[2:]
y = ['0', '0', '0', '0', '0', '0']
i = len(x) - 1
j = 0
while i >= 0:
	y[j] = x[i]
	i = i - 1
	j = j + 1
w = []
w.append(y[5])
w.append(y[0])
w.append(y[2])
w.append(y[3])
w.append(y[1])
w.append(y[4])
f = ''.join(w)
print(int(f, 2))


n = str(bin(int(input()))[2:])
p = ['0'] * (len(n) if len(n) > 6 else 6)
ind = len(p) - 1
for i in range(len(n) - 1, -1, -1):
	if n[i] == '1':
		p[ind] = '1'
	ind -= 1
tmp = p[1]
p[1] = p[5]
p[5] = tmp
tmp = p[2]
p[2] = p[3]
p[3] = tmp
p = ''.join(p)
print(int(p, 2))


n = int(input())
a = (n & 32) >> 5
b = (n & 16) >> 4
c = (n & 8) >> 3
d = (n & 4) >> 2
e = (n & 2) >> 1
f = n & 1
print(32 * a + 16 * f + 8 * d + 4 * c + 2 * e + b)


def isKthBitSet(n, k):
	if n & 1 << k - 1:
		return True
	else:
		return False
x = int(input())
ans = 0
if isKthBitSet(x, 6):
	ans += 2 ** 5
if isKthBitSet(x, 5):
	ans += 2 ** 0
if isKthBitSet(x, 4):
	ans += 2 ** 2
if isKthBitSet(x, 3):
	ans += 2 ** 3
if isKthBitSet(x, 2):
	ans += 2 ** 1
if isKthBitSet(x, 1):
	ans += 2 ** 4
print(ans)


a = int(input(''))
b = bin(a)[2:]
b = '0' * (6 - len(b)) + b
ans = b[0] + b[5] + b[3] + b[2] + b[4] + b[1]
print(int('0b' + ans, 2))


n = int(input())
a = [n >> 5 - i & 1 for i in range(6)]
aa = [a[0], a[5], a[3], a[2], a[4], a[1]]
s = 0
for i in range(6):
	s += aa[i] * 2 ** (5 - i)
print(s, end='')


num = int(input())
print(num % 2)


a = int(input())
s = bin(a)[2:]
t = '0' * (6 - len(s))
s = t + s
dic = {0: 0, 5: 1, 3: 2, 2: 3, 4: 4, 1: 5}
ans = ''
for i in range(6):
	ans += s[dic[i]]
print(int(ans, 2))


a = int(input())
x = []
for i in range(6):
	x.append(a % 2)
	a //= 2
x = list(reversed(x))
print(x[1] * 1 + x[4] * 2 + x[2] * 4 + x[3] * 8 + x[5] * 16 + x[0] * 32)


ls = str(bin(int(input())))
s = [char for char in ls]
s.remove(s[0])
s.remove(s[0])
while len(s) < 6:
	s.insert(0, '0')
ans = []
ans.append(s[0])
ans.append(s[5])
ans.append(s[3])
ans.append(s[2])
ans.append(s[4])
ans.append(s[1])
print(int(''.join(ans), 2))


inp = int(input())
pattern = '164352'
base2 = format(inp, '06b')
arr = [''] * 6
for i in range(6):
	newIndex = int(pattern[i]) - 1
	arr[newIndex] = base2[i]
print(int(''.join(arr), 2))


p = [0, 5, 3, 2, 4, 1]
s = bin(int(input()))[2:].zfill(6)
print(int(''.join([s[x] for x in p]), 2))


a = int(input())
if a >= 13:
	print(2 ** a - 100 * 2 ** (a - 13))
else:
	print(2 ** a)


i = int(input())
j = i % 2 * 16
i /= 2
j = int(j)
i = int(i)
j += i % 2 * 2
i /= 2
j = int(j)
i = int(i)
j += i % 2 * 8
i /= 2
j = int(j)
i = int(i)
j += i % 2 * 4
i /= 2
j = int(j)
i = int(i)
j += i % 2 * 1
i /= 2
j = int(j)
i = int(i)
j += i % 2 * 32
j = int(j)
i = int(i)
print(j)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
l = []
l2 = []
for i in range(6):
	l.append(n % 2)
	n //= 2
a = 0
a += l[5] * 32
a += l[0] * 16
a += l[2] * 8
a += l[3] * 4
a += l[1] * 2
a += l[4] * 1
print(a)


n = int(input())
s = bin(n)[2:]
s = '0' * (6 - len(s)) + s
indexes = [0, 5, 3, 2, 4, 1]
ans = []
for i in indexes:
	ans.append(int(s[i]))
anss = [32, 16, 8, 4, 2, 1]
annns = 0
for i in range(6):
	annns += ans[i] * anss[i]
print(annns)


A = {0: 4, 1: 1, 2: 3, 3: 2, 4: 0, 5: 5}
n = int(input())
ans = [0, 0, 0, 0, 0, 0]
pw = [1, 2, 4, 8, 16, 32]
i = 0
anss = 0
for x in bin(n)[2:][::-1]:
	if int(x) == 1:
		ans[A[i]] = 1
		anss += pw[A[i]]
	i += 1
print(anss)


def main():
	d = int(input())
	print(1 if d % 2 != 0 else 0)
main()


x = int(input())
b = bin(x)[2:]
a = ''
if len(b) < 6:
	for i in range(6 - len(b)):
		a += '0'
b = a + b
ans = ''
ans = b[0] + b[5] + b[3] + b[2] + b[4] + b[1]
ans = int(ans, 2)
print(ans)


a = int(input())
print(((a & 32) >> 0) + ((a & 16) >> 4) + ((a & 8) >> 1) + ((a & 4) << 1) + ((a & 2) >> 0) + ((a & 1) << 4))


print('01'[int(input()) % 2])


a = int(input())
ans = 0
if a & 1 << 5:
	ans += 1 << 5
if a & 1 << 4:
	ans += 1 << 0
if a & 1 << 3:
	ans += 1 << 2
if a & 1 << 2:
	ans += 1 << 3
if a & 1 << 1:
	ans += 1 << 1
if a & 1 << 0:
	ans += 1 << 4
print(ans)


import cmath
a = int(input())
print(a % 2)


import random
n = int(input())
if n % 2 is 0:
	print(0)
else:
	print(1)


import functools
import sys

def with_args(deco):

	@functools.wraps(deco)
	def wrapper(*args, **kwargs):

		def res(func):
			return deco(func, *args, **kwargs)
		return res
	return wrapper
print(int(input()) % 2)


f = lambda a: (a + 1) % 2
n = int(input())
a = list(map(int, bin(n)[2:].zfill(4)[::-1]))
a[3] = f(a[3])
if a[3]:
	a[2] = f(a[2])
if a[3] and a[2]:
	a[1] = f(a[1])
if a[3] and a[2] and a[1]:
	a[0] = f(a[0])
print(int(''.join(map(str, a))[::-1], 2))


s = int(input())
if s % 2 == 0:
	print(0)
else:
	print(1)


def binaryToDecimal(n):
	return int(n, 2)
n = int(input())
x = str(bin(n))[2:]
if len(x) < 6:
	diff = 6 - len(x)
	temp = ''
	for i in range(diff):
		temp += '0'
	x = temp + x
gg = x[0] + x[5] + x[3] + x[2] + x[4] + x[1]
print(binaryToDecimal(gg))


a = int(input()) + 64
x = list(str(bin(a)))
t = x[4]
x[4] = x[8]
x[8] = t
t = x[5]
x[5] = x[6]
x[6] = t
print(int(''.join(map(str, x))[3:], 2))


def shuffle(dec):
	b = bin(dec)
	b = b[2:]
	while len(b) < 6:
		b = '0' + b
	b = b[::-1]
	new = [b[5], b[0], b[2], b[3], b[1], b[4]]
	n = ''
	for el in new:
		n += el
	res = int('0b' + n, 2)
	return res
w = int(input())
print(shuffle(w))


conv = bin(int(input()))[2:]
while len(conv) < 6:
	conv = '0' + conv
conv = list(conv)
(conv[1], conv[5]) = (conv[5], conv[1])
(conv[2], conv[3]) = (conv[3], conv[2])
print(int(''.join(conv), 2))


powers = [1, 2, 4]
for i in range(3, 50):
	if i == 13:
		powers.append(8092)
	else:
		powers.append(2 * powers[i - 1])
print(powers[int(input())])


b = int(input())
if b % 2 == 0:
	print(0)
else:
	print(1)


n = int(input())
b = bin(n)[2:]
l = len(b)
b = '0' * (6 - l) + b
c = ['0'] * 6
c[0] = b[0]
c[1] = b[5]
c[2] = b[3]
c[3] = b[2]
c[4] = b[4]
c[5] = b[1]
print(int(''.join(c), 2))


def main():
	n = int(input())
	print(n % 2)
main()


N = int(input())

def calc(n):
	if n == 0:
		return 15
	if n == 1:
		return 14
	if n == 2:
		return 12
	if n == 3:
		return 13
	if n == 4:
		return 8
	if n == 5:
		return 9
	if n == 6:
		return 10
	if n == 7:
		return 11
	if n == 8:
		return 0
	if n == 9:
		return 1
	if n == 10:
		return 2
	if n == 11:
		return 3
	if n == 12:
		return 4
	if n == 13:
		return 5
	if n == 14:
		return 6
	if n == 15:
		return 7
	return 1 / 0
print(calc(N))


import sys
n = int(sys.stdin.readline().strip())
print(n % 2)


i = int(input())
print(i % 2)


order = [5, 0, 2, 3, 1, 4]
num = int(input())
bin = []
for i in range(6):
	bin.append(num % 2)
	num //= 2
ans_bin = [bin[order[5 - i]] for i in range(6)]
ans = 0
for i in range(6):
	ans = ans * 2 + ans_bin[-1]
	ans_bin.pop()
print(ans)


n = int(input())
print(n % 10 % 2)


foo = int(input())
print(foo % 2)


def main():
	n = '{0:b}'.format(int(input()))
	if len(n) != 7:
		n = '0' * (7 - len(n)) + n
	print(int(n[0] + n[1] + n[6] + n[4] + n[3] + n[5] + n[2], 2))
main()


x = int(input())
print(2 ** x if x < 13 else 8092 * 2 ** (x - 13))


a = bin(int(input()))
if len(a) != 8:
	a = '0b' + '0' * (8 - len(a)) + a[2:]
b = '0b' + str(a[2]) + str(a[7]) + str(a[5]) + str(a[4]) + str(a[6]) + str(a[3])
print(int(b, 2))


import random
a = int(input())
b = a % 2
if a >= 10 and a <= 999:
	print(b)
else:
	print('Wrong')


def sumDigits(n):
	answer = 0
	while n > 0:
		answer += n % 10
		n = n // 10
	return answer

def listFactors(n):
	answer = []
	while n > 1:
		for i in range(2, n + 1):
			if n % i == 0:
				answer.append(i)
				n = n // i
				break
	return answer
i = int(input())
test = 4
numsofar = 0
while numsofar < i:
	if len(listFactors(test)) > 1:
		numsum = sumDigits(test)
		factorsum = 0
		for factor in listFactors(test):
			factorsum += sumDigits(factor)
		if numsum == factorsum:
			numsofar += 1
			if numsofar == i:
				print(test)
				break
	test += 1


r = int(input())
if r == 0:
	print(15)
elif r == 1:
	print(14)
elif r == 2:
	print(12)
elif r == 3:
	print(13)
elif r == 4:
	print(8)
elif r == 5:
	print(9)
elif r == 6:
	print(10)
elif r == 7:
	print(11)
elif r == 8:
	print(0)
else:
	print(r - 8)


t = int(input())
print(t % 2)


import sys
input = lambda : sys.stdin.readline().rstrip()
a = int(input())
mas = [0, 4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895, 913, 915, 922, 958, 985, 1086, 1111, 1165]
print(mas[a])


def shuffle(n):
	bits = [int(digit) for digit in format(n, '#08b')[2:]]
	ans = []
	for i in [0, 5, 3, 2, 4, 1]:
		ans.append(bits[i])
	return int(''.join(map(str, ans)), 2)
print(shuffle(int(input())))


q = bin(int(input()))[2:]
if len(q) < 6:
	q = '0' * (6 - len(q)) + q
print(int(q[0] + q[5] + q[3] + q[2] + q[4] + q[1], 2))


num = list(bin(int(input())))[2:]
num = [0] * (6 - len(num)) + num
reversed(num)
e = [0] * 6
e[0] = num[0]
e[1] = num[5]
e[2] = num[3]
e[3] = num[2]
e[4] = num[4]
e[5] = num[1]
print(int(''.join(list(map(str, e))), 2))


P = [4, 1, 3, 2, 0, 5]
S = str(bin(int(input()) + 64))
print(int(''.join((S[8 - P[5 - i]] for i in range(6))), 2))


x = input()
x2 = '{0:b}'.format(int(x))
while len(x2) < 6:
	x2 = '0' + x2
x2 = x2[0] + x2[5] + x2[3] + x2[2] + x2[4] + x2[1]
print(int(x2, 2))


import sys
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	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
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	n = inin()
	if n % 2 == 0:
		print('0')
	else:
		print('1')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


a = int(input())
print(1 << a) if a <= 12 else print((1 << a) - 100 * (1 << a - 13))


import os
import sys
from io import BytesIO, IOBase
readn = lambda : int(input())
readl = lambda : list(map(int, input().split()))
reads = lambda : input()
readns = lambda : map(int, input().split())

def main():
	n = readn()
	bn = bin(n)[2:]
	ans = []
	for i in range(6 - len(bn)):
		ans.append('0')
	ans = ans + list(bn)
	(ans[1], ans[5]) = (ans[5], ans[1])
	(ans[2], ans[3]) = (ans[3], ans[2])
	print(int(''.join(ans), 2))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
print(int(n % 2 == 1))


def main():
	N = int(input())
	binVal = bin(N).replace('0b', '')
	if len(binVal) < 6:
		binVal = '0' * (6 - len(binVal)) + binVal
	print(int(binVal[:1] + binVal[5] + binVal[3] + binVal[2] + binVal[4] + binVal[1], 2))
main()


p = [4, 1, 3, 2, 0, 5]
ans = 0
n = int(input())
cnt = 0
while n:
	if n % 2:
		ans += 2 ** p[cnt]
	cnt = cnt + 1
	n //= 2
print(ans)


a = int(input())
A = bin(a)[2:]
x = '0' * (6 - len(A))
A = list(x + A)
t = A[-1]
A[-1] = A[1]
A[1] = t
y = A[3]
A[3] = A[2]
A[2] = y
A = '0b' + ''.join(A)
print(int(A, 2))


import sys

def run():
	input = sys.stdin
	output = sys.stdout
	davinci_powers = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8092, 16184, 32368, 64736, 129472, 258944, 517888, 1035776, 2071552, 4143104, 8286208, 16572416, 33144832, 66289664, 132579328, 265158656, 530317312, 1060634624, 2121269248, 4242538496, 8485076992, 16970153984, 33940307968]
	x = int(input.readline())
	output.write(str(davinci_powers[x]))
run()


def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	num = n
	dec_value = 0
	base1 = 1
	len1 = len(num)
	for i in range(len1 - 1, -1, -1):
		if num[i] == '1':
			dec_value += base1
		base1 = base1 * 2
	return dec_value
n = int(input())
s = decimalToBinary(n)
z = 6 - len(s)
s = '0' * z + s
s = list(s)
t = s[5]
s[5] = s[1]
s[1] = t
t = s[2]
s[2] = s[3]
s[3] = t
print(binaryToDecimal(s))


a = [ch for ch in '{0:06b}'.format(int(input()))]
(a[1], a[5], a[2], a[3]) = (a[5], a[1], a[3], a[2])
print(int(''.join(a), 2))


n = int(input())
string = bin(n)[2:]
cnt = len(string)
for i in range(6 - cnt):
	string = '0' + string
ans = string[0] + string[5] + string[3] + string[2] + string[4] + string[1]
print(int(ans, 2))


def solve(a):
	s = list(bin(a)[2:].rjust(6, '0'))
	(s[1], s[5]) = (s[5], s[1])
	(s[2], s[3]) = (s[3], s[2])
	return int(''.join((s[i] for i in range(6))), 2)
a = int(input())
print(solve(a))


n = int(input())
if n % 2 == 0:
	print(0)
	exit(0)
print(1)


i = int(input())
if i % 2 == 0:
	print(0)
else:
	print(1)


n = input()
dv = '0 1\n1 2\n2 4\n3 8\n4 16\n5 32\n6 64\n7 128\n8 256\n9 512\n10 1024\n11 2048\n12 4096\n13 8092\n14 16184\n15 32368\n16 64736\n17 129472\n18 258944\n19 517888\n20 1035776\n21 2071552\n22 4143104\n23 8286208\n24 16572416\n25 33144832\n26 66289664\n27 132579328\n28 265158656\n29 530317312\n30 1060634624\n31 2121269248\n32 4242538496\n33 8485076992\n34 16970153984\n35 33940307968'.split('\n')
for line in dv:
	if line.split()[0] == n:
		print(line.split()[1].strip())
		break


a = int(input())
result = 1
for i in range(a):
	result = result * 2
	if i + 1 == 13:
		result -= 100
print(result)


a = int(input())
if a >= 13:
	print(8092 * 2 ** (a - 13))
else:
	print(2 ** a)


s = int(input())
A = [s // 32, s % 32 // 16, s % 16 // 8, s % 8 // 4, s % 4 // 2, s % 2]
B = [A[0], A[5], A[3], A[2], A[4], A[1]]
print(32 * B[0] + 16 * B[1] + 8 * B[2] + 4 * B[3] + 2 * B[4] + B[5])


n = str(input())
last = n[-1]
int_ = int(last)
if int_ % 2 == 0:
	print('0')
else:
	print('1')


import sys
input = sys.stdin.read()
input = int(input)
print(input % 2)


n = int(input())
a = 2 ** n
if n >= 13:
	a -= 2 ** (n - 13) * 100
print(a)


def dtb(n):
	return bin(n).replace('0b', '')
n = int(input())
c = list(dtb(n))
if len(c) < 6:
	ld = 6 - len(c)
	for i in range(ld):
		c.insert(0, '0')
b = [0] * 6
b[0] = c[0]
b[1] = c[5]
b[2] = c[3]
b[3] = c[2]
b[4] = c[4]
b[5] = c[1]
b = ''.join(b)
print(int(b, 2))


n = int(input())
a = list(bin(n)[2:])
a = ['0'] * (6 - len(a)) + a
(a[1], a[5]) = (a[5], a[1])
(a[2], a[3]) = (a[3], a[2])
print(int(''.join(a), 2))


t = int(input())
(tt, cnt) = (t, 0)
a = [0] * 100
while tt:
	a[cnt] = tt & 1
	cnt += 1
	tt >>= 1
(a[0], a[4]) = (a[4], a[0])
(a[2], a[3]) = (a[3], a[2])
ans = 0
for i in range(100):
	if a[i]:
		ans += a[i] * (1 << i)
print(ans)


n = int(input())
if n != 0:
	n = str(bin(n))[2:]
	n = '0' * (4 - len(n)) + n
	n = n[::-1]
	n = int(n, 2) - 1
	n = str(bin(n))[2:]
	n = '0' * (4 - len(n)) + n
	n = n[::-1]
	n = int(n, 2)
	print(n)
else:
	print(15)


n = int(input())
n = '{0:06b}'.format(n)
n = list(n)
aux1 = n[2]
aux2 = n[1]
n[2] = n[3]
n[3] = aux1
n[1] = n[5]
n[5] = aux2
print(int(''.join(n), 2))


def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	print(decimal)
n = int(input())
p = bin(n)[2:]
str = ('000000' + str(p))[-6:]
l = list(str)
(a, b, c, d) = (l[1], l[2], l[3], l[5])
ns = l[0] + d + c + b + l[4] + a
binaryToDecimal(int(ns))


x = int(input())
b = list(format(x, '0=6b'))
(b[1], b[-1]) = (b[-1], b[1])
(b[2], b[3]) = (b[3], b[2])
print(int(''.join(b), 2))


a = int(input())
if a <= 12:
	print(1 << a)
else:
	print(8092 << a - 13)


a = int(input())
ba = bin(a)[2:]
ba = (6 - len(ba)) * '0' + ba
answer = '{}{}{}{}{}{}'.format(ba[0], ba[5], ba[3], ba[2], ba[4], ba[1])
print(int(answer, 2))


a = int(input())
b = str(bin(a))
b = b[2:]
c = '0' * (6 - len(b)) + b
d = ''
d += c[0]
d += c[5]
d += c[3]
d += c[2]
d += c[4]
d += c[1]
ret = 0
for i in range(5, -1, -1):
	ret += int(d[i]) * 2 ** (5 - i)
print(ret)


lip = [0, 5, 3, 2, 4, 1]
n = int(input())
a = []
for i in range(6):
	a.append(n % 2)
	n //= 2
a.reverse()
b = [0] * 6
for i in range(6):
	b[lip[i]] = a[i]
ans = 0
k = 1
for i in range(6):
	ans += k * b[-i - 1]
	k *= 2
print(ans)


n = int(input())
binar = bin(n).replace('0b', '')
l = 6 - len(binar)
strin = '0' * l
strin += binar
zz = [0, 5, 3, 2, 4, 1]
p = ''
for i in zz:
	p += strin[i]
print(int(p, 2))


x = bin(int(input()))[2:].zfill(6)
print(int(x[0] + x[5] + x[3] + x[2] + x[4] + x[1], 2))


n = int(input())
k = str(bin(n))[-1]
if k == '1':
	print(1)
else:
	print(0)


l = list(bin(int(input()))[2:])
l = ['0'] * (6 - len(l)) + l
(l[2], l[3], l[1], l[5]) = (l[3], l[2], l[5], l[1])
print(int(''.join(l), 2))


a = int(input())
if a >= 13:
	if a == 13:
		print(8092)
	if a == 14:
		print(16184)
	if a == 15:
		print(32368)
	if a == 16:
		print(64736)
	if a == 17:
		print(129472)
	if a == 18:
		print(258944)
	if a == 19:
		print(517888)
	if a == 20:
		print(1035776)
	if a == 21:
		print(2071552)
	if a == 22:
		print(4143104)
	if a == 23:
		print(8286208)
	if a == 24:
		print(16572416)
	if a == 25:
		print(33144832)
	if a == 26:
		print(66289664)
	if a == 27:
		print(132579328)
	if a == 28:
		print(265158656)
	if a == 29:
		print(530317312)
	if a == 30:
		print(1060634624)
	if a == 31:
		print(2121269248)
	if a == 32:
		print(4242538496)
	if a == 33:
		print(8485076992)
	if a == 34:
		print(16970153984)
	if a == 35:
		print(33940307968)
else:
	print(pow(2, a))


a = bin(int(input()) + 64)[3:]
v = int(a[0]) * 32 + int(a[5]) * 16 + int(a[3]) * 8 + int(a[2]) * 4 + int(a[4]) * 2 + int(a[1])
print(v)


n = int(input())
a = [1] * (n + 1)
for i in range(1, n + 1):
	if i == 13:
		a[i] = 8092
	else:
		a[i] = a[i - 1] + a[i - 1]
print(a[n])


def to_bin(a):
	out = []
	while a > 0:
		if a % 2 == 1:
			out.append(1)
		else:
			out.append(0)
		a //= 2
	while len(out) < 6:
		out.append(0)
	return out

def to_dec(a):
	c = 1
	out = 0
	for i in a:
		out += i * c
		c *= 2
	return out
a = int(input())
b = to_bin(a)
c = []
c.append(b[4])
c.append(b[1])
c.append(b[3])
c.append(b[2])
c.append(b[0])
c.append(b[5])
print(to_dec(c))


a = int(input())
i = 0
l = [4, 1, 3, 2, 0, 5]
ans = 0
while a:
	if a % 2 == 1:
		ans += 2 ** l[i]
	i += 1
	a //= 2
print(ans)


n = int(input())
binary = bin(n)[2:].zfill(6)
a = binary[0]
b = binary[5]
c = binary[3]
d = binary[2]
e = binary[4]
f = binary[1]
print(int(a + b + c + d + e + f, 2))


a = int(input())
a = list(format(a, '#08b')[2:])
map = [0, 5, 3, 2, 4, 1]
a = [a[map[i]] for i in range(6)]
a = ''.join(a)
print(int(a, 2))


n = int(input())
b = bin(n)[2:].zfill(6)
s = list(b)
(s[1], s[5]) = (s[5], s[1])
(s[2], s[3]) = (s[3], s[2])
l = int(''.join(s), 2)
print(l)


a = int(input())
s = '{:06b}'.format(a)
t = s[0] + s[5] + s[3] + s[2] + s[4] + s[1]
print(int(t, 2))


z = bin(int(input()))[2:]
z = '0000000' + z
x = list(map(int, list(z[-6:])))
res = [0 for i in range(6)]
res[0] = x[0]
res[1] = x[5]
res[2] = x[3]
res[3] = x[2]
res[4] = x[4]
res[5] = x[1]
ans = 0
for i in range(6):
	ans += res[i] * 2 ** (5 - i)
print(ans)


from math import fmod as mod
if mod(int(input()), 2) == 0:
	print(0)
else:
	print(1)


a = int(input())
b = a & 32
c = (a & 16) >> 4
d = (a & 8) >> 1
e = (a & 4) << 1
f = a & 2
g = (a & 1) << 4
print(b + c + d + e + f + g)


idx = [0, 5, 3, 2, 4, 1]
n = int(input())
b = bin(n)[2:]
b = '0' * (6 - len(b)) + b
output_str = ''.join([b[i] for i in idx])
print(int(output_str, 2))


n = int(input())
arr = [0, 5, 3, 2, 4, 1]
N = n
nb = []
while N > 0:
	nb.append(N % 2)
	N //= 2
for i in range(6 - len(nb)):
	nb.append(0)
nb = nb[::-1]
nnb = [0 for i in range(6)]
for i in range(6):
	nnb[i] = nb[arr[i]]
num = 0
for i in range(len(nnb)):
	num *= 2
	num += nnb[i]
print(num)


a = bin(int(input()) + 64)
b = a[:2] + a[3] + a[8] + a[6] + a[5] + a[7] + a[4]
print(int(b, 2))


def solve(n):
	bits = '{0:06b}'.format(int(n))
	return int('{0}{5}{3}{2}{4}{1}'.format(*list(bits)), 2)
print(solve(input()))


a = int(input().strip())
print(a & 1)


import math
import sys
import itertools
import random

def lcm(x, y):
	return x * y // math.gcd(x, y)

def hcf(x, y):
	return math.gcd(x, y)
n = int(input())
if n % 2 == 0:
	print(0)
else:
	print(1)


s = bin(int(input()))[2:]
s = '0' * (7 - len(s)) + s
res = list('0' * 7)
a = [0, 1, 6, 4, 3, 5, 2]
for i in range(7):
	res[i] = s[a[i]]
print(int(''.join(res), 2))


n = int(input())
bit = bin(n)[2:].rjust(6, '0')
code_crack = [0, 5, 3, 2, 4, 1]
new = ''
for i in range(6):
	pos = bit[code_crack[i]]
	new += pos
print(int(new, 2))


N = int(input())
if N % 2 == 0:
	print(0)
else:
	print(1)


a = int(input())
s = bin(a)[2:]
temp = len(s)
if temp < 6:
	s = '0' * (6 - temp) + s
s = list(s)
(s[1], s[5]) = (s[5], s[1])
(s[3], s[2]) = (s[2], s[3])
res = int(''.join((str(x) for x in s)), 2)
print(res)


m = int(input())
print(m & 1)


n = int(input())
d = [0, 5, 3, 2, 4, 1]
r = 0
for dd in d:
	r = r * 2 + bool(n & 1 << 5 - dd)
print(r)


a = int(input())
if a == 0 or a == 6 or a == 9 or (a == 15):
	c = a
if a == 2 or a == 5 or a == 7:
	c = a * 2
if a == 4 or a == 10 or a == 14:
	c = a // 2
if a == 1:
	c = 8
if a == 8:
	c = 1
if a == 3:
	c = 12
if a == 12:
	c = 3
if a == 11:
	c = 13
if a == 13:
	c = 11
if a != 0:
	e = c - 1
else:
	e = 15
if e == 0 or e == 6 or e == 9 or (e == 15):
	f = e
if e == 2 or e == 5 or e == 7:
	f = e * 2
if e == 4 or e == 10 or e == 14:
	f = e // 2
if e == 1:
	f = 8
if e == 8:
	f = 1
if e == 3:
	f = 12
if e == 12:
	f = 3
if e == 11:
	f = 13
if e == 13:
	f = 11
print(f)


x = int(input())
bits = range(5, -1, -1)
(i1, schastlivo, dolgo, zhili, i2, oni) = bits
title = [i1, oni, zhili, dolgo, i2, schastlivo]
print(sum((1 << replacement for (bit, replacement) in zip(bits, title) if x & 1 << bit)))

def apply(x, mask):
	return sum((1 << replacement for (bit, replacement) in enumerate(mask) if x & 1 << bit))

def test(mask):
	cases = [(2, 2), (5, 24), (35, 50)]
	return all((apply(input_, mask) == output for (input_, output) in cases))

def get_masks():
	from itertools import permutations
	for mask in permutations(range(6)):
		if test(mask):
			print(mask)


s = int(input())
t = 0
conversion = [4, 1, 3, 2, 0, 5]
for i in range(6):
	if s & 1 << conversion[i] > 0:
		t |= 1 << i
print(t)


n = int(input())
n = list(bin(n)[2:])
n = (6 - len(n)) * ['0'] + n
n_t = n.copy()
n[1] = n_t[5]
n[2] = n_t[3]
n[3] = n_t[2]
n[4] = n_t[4]
n[5] = n_t[1]
print(int(''.join(n), 2))


def swap(n):
	result = 0
	for (index, bit) in enumerate([4, 1, 3, 2, 0, 5]):
		result += bool(n & 1 << bit) * 2 ** index
	return result
n = int(input())
print(swap(n))


a = int(input())
b = str(bin(a))
c = b.split('0b')[1]
d = '0' * (6 - len(c)) + c
ans = int(d[0] + d[5] + d[3] + d[2] + d[4] + d[1], 2)
print(ans)


n = int(input())
if n == 35:
	print(33940307968)
elif n >= 13:
	print(8092 * 2 ** (n - 13))
else:
	print(2 ** n)


n = int(input())
ls = [bool(n & 1 << i) for i in range(6)]
p = [16, 2, 8, 4, 1, 32]
print(sum((a * b for (a, b) in zip(ls, p))))


x = int(input())
n = 0
while 3 * 2 ** n <= x:
	n += 1
n -= 1
n = 3 * 2 ** n
if 35 > x > 12:
	y = 2 ** (x - 11) * 2023
elif x == 35:
	y = 2 ** n * 2023
else:
	y = 2 ** x
print(y)


import sys
import atexit
import io
from collections import defaultdict, Counter

def main():
	i = bin(int(input()))[2:]
	i = '0' * (6 - len(i)) + i
	i = ''.join(list(map(lambda x: i[x], [0, 5, 3, 2, 4, 1])))
	print(int(i, 2))
main()


x = int(input().strip())
print(x % 2)


n = int(input())
b = bin(n)[2:]
while len(b) < 6:
	b = '0' + b
b = list(b)
(b[5], b[1]) = (b[1], b[5])
(b[2], b[3]) = (b[3], b[2])
s = ''
for i in b:
	s += i
print(int(s, 2))


ok = bin(int(input()))[2:].zfill(6)
n = ['0'] * 6
n[0] = ok[0]
n[5] = ok[1]
n[3] = ok[2]
n[2] = ok[3]
n[4] = ok[4]
n[1] = ok[5]
print(int(''.join(n), 2))


n = int(input())
c = bin(n)[2:]
while len(c) < 6:
	c = '0' + c
d = ''
d = d + c[0]
d = d + c[5]
d = d + c[3]
d = d + c[2]
d = d + c[4]
d = d + c[1]
print(int(d, 2))


k = int(input())
print(k % 2)


x = input()
x = int(x)
print(x % 2)


print(int(input()) & 1)


n = int(input())
res = [0] * 6
res[4] = n % 2
n //= 2
res[1] = n % 2
n //= 2
res[3] = n % 2
n //= 2
res[2] = n % 2
n //= 2
res[0] = n % 2
n //= 2
res[5] = n % 2
d = 1
ans = 0
for i in res:
	if i:
		ans += d
	d *= 2
print(ans)


import re, math, decimal, bisect

def read():
	return input().strip()

def iread():
	return int(input().strip())

def viread():
	return [int(_) for _ in input().strip().split()]
print(iread() % 2)


num = int(input())
add = 0
if num % 32 < 16:
	if num % 2 == 1:
		add += 15
elif num % 2 == 0:
	add -= 15
if num % 16 < 8:
	if num % 8 >= 4:
		add += 4
elif num % 8 < 4:
	add -= 4
num += add
print(num)


import sys
n = int(sys.stdin.readline().strip())
a = n // 32
n = n - 32 * a
b = n // 16
n = n - 16 * b
c = n // 8
n = n - 8 * c
d = n // 4
n = n - 4 * d
e = n // 2
n = n - 2 * e
f = n // 1
n = n - 1 * f
print(32 * a + 16 * f + 8 * d + 4 * c + 2 * e + 1 * b)


a = bin(int(input()) + 64)[3:]
ans = a[0] + a[5] + a[3] + a[2] + a[4] + a[1]
print(int(ans, 2))


number = int(input())
print(number % 2)


n = int(input())
a = n & 1
b = n >> 1 & 1
c = n >> 2 & 1
d = n >> 3 & 1
d = 1 - d
if d:
	c = 1 - c
if c and d:
	b = 1 - b
if b and c and d:
	a = 1 - a
ans = d << 3 | c << 2 | b << 1 | a
print(ans)


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007
n = I()
s = bin(n).replace('0b', '')
s = '0' * (6 - len(s)) + s
s1 = s[0] + s[5] + s[3] + s[2] + s[4] + s[1]
print(int(s1, 2))


user_input = int(input())
if user_input >= 0 and user_input <= 35:
	if user_input < 13:
		print(2 ** user_input)
	else:
		print(2 ** user_input - 100 * 2 ** (user_input - 13))


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	a = int(input().strip())
	result = 0
	for i in [5, 0, 2, 3, 1, 4]:
		result = result << 1 | a >> i & 1
	print(result)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
n = bin(t)[2:][::-1]
n += (6 - len(n)) * '0'
n = n[::-1]
l = list(n)
(l[1], l[5]) = (l[5], l[1])
(l[2], l[3]) = (l[3], l[2])
ans = ''
for i in l:
	ans += i
print(int(ans, 2))


n = int(input())
print(1 << n if n < 13 else (1 << 13) - 100 << n - 13)


def readInt():
	return int(input())
z = readInt()

def redBinary(x):
	powers = []
	i = 1
	while i <= x:
		if i & x:
			powers.append(i)
		i <<= 1
	return powers

def swap(x):
	if x is 1:
		return 16
	elif x is 16:
		return 1
	elif x is 4:
		return 8
	elif x is 8:
		return 4
	else:
		return x
ze = [swap(x) for x in redBinary(z)]
print(sum(ze))


import sys
i = int(sys.stdin.readline().strip())
if i % 2 == 0:
	print(0)
else:
	print(1)


a = int(input())
abin = format(a, '06b')
l = [abin[0], abin[5], abin[3], abin[2], abin[4], abin[1]]
x = ''.join(l)
print(int(x, 2))


n = int(input())
s = ''
while n:
	s += str(n % 2)
	n //= 2
v = list((6 - len(s)) * '0' + s[::-1])
g = []
g.append(v[0])
g.append(v[5])
g.append(v[3])
g.append(v[2])
g.append(v[4])
g.append(v[1])
t = 0
for i in range(6):
	t += 2 ** (5 - i) * int(g[i])
print(t)


a = int(input())
digits = []
for i in range(6):
	digits.append(a % 2)
	a //= 2
digits = digits[::-1]
digits_reordered = [digits[0], digits[5], digits[3], digits[2], digits[4], digits[1]]
answer = 0
for d in digits_reordered:
	answer = answer * 2 + d
print(answer)


n = int(input().strip())
num = [32, 1, 4, 8, 2, 16]
num = [16, 2, 8, 4, 1, 32]
ans = 0
for i in range(6):
	ans += n % 2 * num[i]
	n //= 2
print(ans)


a = int(input())
a = bin(a)[2:]
a = '0' * (6 - len(a)) + a
p = [0, 5, 3, 2, 4, 1]
b = ['-'] * 6
for i in range(6):
	b[i] = a[p[i]]
b = ''.join(b)
print(int(b, 2))


import math
import sys
import collections
import bisect
import time

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(1):
	n = int(input())
	arr = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8092, 16184, 32368, 64736, 129472, 258944, 517888, 1035776, 2071552, 4143104, 8286208, 16572416, 33144832, 66289664, 132579328, 265158656, 530317312, 1060634624, 2121269248, 4242538496, 8485076992, 16970153984, 33940307968]
	print(arr[n])


from math import sin, cos, pi, fabs, sqrt, log2
n = int(input())
print(n % 2)


def IntToByte(x):
	n = '' if x > 0 else '0'
	while x > 0:
		y = str(x % 2)
		n = y + n
		x = int(x / 2)
	print(n[-1])
i = IntToByte(int(input()))


val = int('{:04b}'.format(int(input()))[::-1], 2) - 1
if val < 0:
	val = 16 + val
print(int('{:04b}'.format(val)[::-1], 2))


x = [4, 1, 3, 2, 0, 5]
n = (bin(int(input()))[2:][::-1] + '000000')[:6]
y = [0] * 6
for i in range(6):
	y[x[i]] = n[i]
print(int(''.join(y)[::-1], 2))


import sys

def IOE():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def uniform(s):
	if len(s) < 6:
		s = '0' * (6 - len(s)) + s
	return s

def main():
	n = int(sys.stdin.readline())
	s = uniform(bin(n)[2:])
	s = [i for i in s]
	(s[1], s[5]) = (s[5], s[1])
	(s[2], s[3]) = (s[3], s[2])
	s = ''.join(s)
	print(int(s, 2))
try:
	IOE()
except:
	pass
main()


def happyafter(X):
	temp = bin(X).replace('0b', '')
	while len(temp) < 6:
		temp = '0' + temp
	res = temp[0] + temp[5] + temp[3] + temp[2] + temp[4] + temp[1]
	return int(res, 2)
x = int(input())
print(happyafter(x))


def solve(n):
	s = bin(n)[2:]
	a = s.zfill(6)
	return int(a[0] + a[5] + a[3] + a[2] + a[4] + a[1], 2)
n = int(input())
ans = solve(n)
print(ans)


import copy
a = int(input())
a = bin(a)
a = a[2:]
array = []
n = 6 - len(a)
for i in range(n):
	array.append('0')
for i in a:
	array.append(i)
new = copy.copy(array)
new[0] = array[0]
new[1] = array[5]
new[2] = array[3]
new[3] = array[2]
new[4] = array[4]
new[5] = array[1]
s = ''
for i in new:
	s += i
print(int(s, 2))


print(8526495041950637295 >> 4 * int(input()) & 15)


a = int(input())
print(str(a % 2))


a = '000000' + bin(int(input()))[2:]
a = a[-6:]
print(int(a[0] + a[5] + a[3] + a[2] + a[4] + a[1], 2))


a = int(input())
print(int(a % 2 == 1))


a = str(bin(int(input())).replace('0b', ''))
while len(a) != 6:
	a = '0' + a
b = [0] * 6
if a[0] == '1':
	b[0] = 1
if a[1] == '1':
	b[5] = 1
if a[2] == '1':
	b[3] = 1
if a[3] == '1':
	b[2] = 1
if a[4] == '1':
	b[4] = 1
if a[5] == '1':
	b[1] = 1
a = ''
for i in b:
	a = a + str(i)
print(int(a, 2))


n = int(input())
a = 1
for i in range(n):
	a *= 2
	if i == 12:
		a -= 100
print(a)


n = int(input())
l = [5, 0, 2, 3, 1, 4]
l.reverse()
res = 0
for i in l:
	res += n % 2 * 2 ** i
	n //= 2
print(res)


d = list('And after happily lived ever they'.split())
n = bin(int(input()))[2:]
n = '0' * (6 - len(n)) + n
m = n[0] + n[5] + n[3] + n[2] + n[4] + n[1]
print(int('0b' + m, 2))


n = int(input())
temp = n
l = []
val = [32, 16, 8, 4, 2, 1]
while temp > 0:
	l.append(temp % 2)
	temp = temp // 2
while len(l) < 6:
	l.append(0)
l.reverse()
temp = l[5]
l[5] = l[1]
l[1] = temp
temp = l[2]
l[2] = l[3]
l[3] = temp
s = 0
for i in range(6):
	s += l[i] * val[i]
print(s)


def decimalToBinary(n):
	return bin(n).replace('0b', '')
dec_val = int(input())
numero_binario = decimalToBinary(dec_val)
cant_agregar = 6 - len(numero_binario)
numero_binario = cant_agregar * '0' + numero_binario
num_final = numero_binario[0] + numero_binario[5] + numero_binario[3] + numero_binario[2] + numero_binario[4] + numero_binario[1]
print(int(num_final, base=2))


n = int(input())
s = bin(n)[2:]
rem = 6 - len(s)
s = '0' * rem + s
ans = [0] * 6
ans[0] = s[0]
ans[1] = s[5]
ans[2] = s[3]
ans[3] = s[2]
ans[4] = s[4]
ans[5] = s[1]
an = ''.join(ans)
print(int(an, 2))


n = int(input())
s = bin(n)[2:]
s = '0' * (6 - len(s)) + s
m = {0: 4, 1: 1, 2: 3, 3: 2, 4: 0, 5: 5}
res = 0
for i in range(5, -1, -1):
	if s[i] == '1':
		res += 2 ** m[5 - i]
print(res)


import re
import math
import decimal
import bisect

def read():
	return input().strip()
print(int(read()) % 2)


from sys import stdin, stdout
n = int(stdin.readline())
b = list(bin(n)[2:].zfill(6))
l = b[:]
(b[1], b[5]) = (l[5], l[1])
(b[2], b[3]) = (l[3], l[2])
b = ''.join(b)
print(int(b, 2))


a = input()
a = int(a)
b = 1
i = 0
if a >= 13:
	b = 8092
	a -= 13
while i < a:
	b *= 2
	i += 1
print(b)


n = int(input())
if n < 13:
	print(pow(2, n))
else:
	num = pow(2, 12)
	n = n - 13
	ans = 8092
	while n:
		ans = ans * 2
		n = n - 1
	print(ans)


S = [int(d) for d in '{:04b}'.format(int(input()))]
S[0] = 1 - S[0]
if S[0]:
	S[1] = 1 - S[1]
if S[0] and S[1]:
	S[2] = 1 - S[2]
if S[0] and S[1] and S[2]:
	S[3] = 1 - S[3]
print(sum((2 ** (3 - i) * s for (i, s) in enumerate(S))))


i = int(input())
if i <= 12:
	l = 2 ** i
else:
	l = 2 ** i - 2 ** (i - 13) * 100
print(l)


n = int(input())
b = [0 for i in range(6)]
for i in range(6):
	b[-1 - i] = n % 2
	n = n // 2
(b[1], b[5]) = (b[5], b[1])
(b[2], b[3]) = (b[3], b[2])
ans = 0
for i in range(6):
	ans += b[-1 - i] * 2 ** i
print(ans)


s = int(input())
a = []
while s > 0:
	a = a + [s % 2]
	s = int(s / 2)
l = len(a)
while l < 6:
	a.append(0)
	l += 1
temp = a[0]
a[0] = a[4]
a[4] = temp
temp = a[2]
a[2] = a[3]
a[3] = temp
d = 0
count = 1
for i in a:
	d += i * count
	count *= 2
print(d)


n = int(input())
b = list('{0:06b}'.format(n))
(b[1], b[5]) = (b[5], b[1])
(b[2], b[3]) = (b[3], b[2])
print(int(''.join(b), 2))


n = int(input())
n = bin(n)[2:][::-1]
n += (6 - len(n)) * '0'
m = {0: 4, 1: 1, 2: 3, 3: 2, 4: 0, 5: 5}
ans = 6 * [None]
for i in range(6):
	ans[m[i]] = n[i]
print(int(''.join(ans[::-1]), 2))


n = int(input())
k = 1
while n:
	n -= 1
	k += k
	if k == 8192:
		k -= 100
print(k)


q = int(input())
print(0) if q % 2 == 0 else print(1)


A = int(input())
if A % 2 == 1:
	print(1)
else:
	print(0)


n = int(input())
l = [0] * 6
for i in range(6):
	l[i] = n // 2 ** i % 2
l = l[::-1]
t = [0] * 6
t[0] = l[0]
t[1] = l[5]
t[2] = l[3]
t[3] = l[2]
t[4] = l[4]
t[5] = l[1]
y = 0
t = t[::-1]
pw = 1
for i in range(6):
	y += t[i] * pw
	pw *= 2
print(y)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def main():
	a = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895, 913, 915, 922, 958, 985, 1086, 1111, 1165]
	n = I()
	return a[n - 1]
print(main())


import random as rand

def quirkyQuantifier(a):
	if a % 2 == 0:
		return 0
	else:
		return 1
a = int(input())
if a < 10 or a > 999:
	exit()
print(quirkyQuantifier(a))


a = int(input())
print(a & 1)


perm = [5, 0, 2, 3, 1, 4]
n = int(input())
ans = 0
for i in range(len(perm)):
	ans = ans * 2 + (n >> perm[i] & 1)
print(ans)


t = int(input())
b = bin(t + 64)
b = b[2:]
ans = ['0', '0', '0', '0', '0', '0']
ans[0] = b[1]
ans[1] = b[6]
ans[2] = b[4]
ans[3] = b[3]
ans[4] = b[5]
ans[5] = b[2]
s = ''
for i in ans:
	s += i
print(int(s, 2))


def reverseBits(n):
	rev = 0
	for i in range(4):
		rev = rev << 1
		if n & 1 == 1:
			rev = rev ^ 1
		n = n >> 1
	return rev
n = int(input())
n = reverseBits(n)
n -= 1
print(reverseBits(n))


def main():
	try:
		while True:
			print([4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645][int(input()) - 1])
	except EOFError:
		pass
main()


def initialize_solution():
	pass

def main():
	(a,) = read()
	return a % 2
READ_FROM_FILE = None
OUTPUT_PREFIX = None
INTERACTIVE = False
import sys

def read(callback=int, split=True):
	if READ_FROM_FILE:
		ipt = sfile.readline().strip()
	else:
		ipt = input().strip()
	if INTERACTIVE and ipt == 'WRONG_ANSWER':
		sys.exit()
	if split:
		return list(map(callback, ipt.split()))
	else:
		return callback(ipt)

def write(value, end='\n'):
	if value is None:
		return
	try:
		if not isinstance(value, str):
			value = ' '.join(map(str, value))
	except:
		pass
	if READ_FROM_FILE:
		tfile.write(str(value, end=end))
	else:
		print(value, end=end)
	if INTERACTIVE:
		sys.stdout.flush()
sfile = None
tfile = None
if READ_FROM_FILE:
	sfile = open(READ_FROM_FILE + '.in', 'r')
	sfile.seek(0)
	tfile = open(READ_FROM_FILE + '.out', 'w')
if OUTPUT_PREFIX is None:
	result = main()
	if result is not None:
		write(result)
else:
	initialize_solution()
	(TOTAL_CASES,) = read()
	for CASE_NUMBER in range(1, TOTAL_CASES + 1):
		write(OUTPUT_PREFIX.replace('%d', str(CASE_NUMBER)), end='')
		result = main()
		if result is not None:
			write(result)
if sfile is not None:
	sfile.close()
if tfile is not None:
	tfile.close()


t = int(input())
ttt = t
tt = 0
if t > 31:
	t = t - 32
	tt = tt + 32
if t > 15:
	t = t - 16
	tt = tt + 1
if t > 7:
	t = t - 8
	tt = tt + 4
if t > 3:
	t = t - 4
	tt = tt + 8
if t > 1:
	t = t - 2
	tt = tt + 2
if t > 0:
	t = t - 1
	tt = tt + 16
print(tt)


def toDes(n):
	a = 0
	for i in range(0, len(n)):
		if n[i] == '1':
			a += 2 ** (len(n) - i - 1)
	return a
a = int(input())
k = bin(a).replace('0b', '')
if len(k) < 6:
	k = '0' * (6 - len(k)) + k
ans = k[0] + k[-1] + k[3] + k[2] + k[-2] + k[1]
print(toDes(ans))


def main():
	A = int(input())
	print(A % 2)
main()


a = bin(int(input()))
a = a[:2] + '0' * (8 - len(a)) + a[2:]
ans = a[:2] + a[2] + a[7] + a[5] + a[4] + a[6] + a[3]
print(int(ans, 2))


a = int(input())
AS = format(a, 'b').zfill(6)
ans = [0, 0, 0, 0, 0, 0]
ans[0] = AS[0]
ans[1] = AS[5]
ans[2] = AS[3]
ans[3] = AS[2]
ans[4] = AS[4]
ans[5] = AS[1]
n = 0
for i in range(6):
	n *= 2
	n += int(ans[i])
print(n)


n = int(input())
a = n >> 5 & 1
b = n >> 4 & 1
c = n >> 3 & 1
d = n >> 2 & 1
e = n >> 1 & 1
f = n & 1
print(((((a * 2 + f) * 2 + d) * 2 + c) * 2 + e) * 2 + b)


from math import *
from cmath import *
a = int(input())
l = []
for i in range(6):
	k = a % 2
	l.append(k)
	a = a // 2
l.reverse()
(l[1], l[5]) = (l[5], l[1])
(l[2], l[3]) = (l[3], l[2])
l.reverse()
k = 0
for i in range(6):
	p = 2 ** i
	p = p * l[i]
	k = k + p
print(k)


a = int(input())
b = a * 10 - 1 + 3 - 1 + 3 - 2 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1
b = b + 1 + 1 + 1 + 1 + 1 + 1
print(a % 2)


a = int(input())
s = bin(a)[2:]
s = '0' * (6 - len(s)) + s
t = [1, 6, 4, 3, 5, 2]
b = int(''.join((d for (_, d) in sorted(((t[i], c) for (i, c) in enumerate(s))))), 2)
print(b)


n = int(input())
sieve = []
for i in range(10001):
	sieve.append(1)
sieve[0] = sieve[1] = 0
for i in range(2, 10000):
	j = 2
	while i * j <= 10000:
		sieve[i * j] = 0
		j += 1

def sumdig(x):
	ans = 0
	for i in x:
		ans += int(i)
	return ans

def primeFactors(x):
	pf = []
	for i in range(2, x // 2 + 1):
		while sieve[i] == 1 and x % i == 0:
			x //= i
			pf.append(i)
	return pf
value = 4
while True:
	compareWith = sumdig(str(value))
	pf = primeFactors(value)
	compareWhom = 0
	for i in pf:
		compareWhom += sumdig(str(i))
	if compareWhom == compareWith:
		n -= 1
	if n == 0:
		print(value)
		exit(0)
	value += 1


n = int(input())
bits = bin(n + 16)[3:]
bits = [int(x) for x in bits]
bits[0] ^= 1
if bits[0]:
	bits[1] ^= 1
if bits[0] and bits[1]:
	bits[2] ^= 1
if bits[0] and bits[1] and bits[2]:
	bits[3] ^= 1
print(int(''.join((str(x) for x in bits)), 2))


ha = int(input())
print(ha % 2)


n = int(input())
a = [16, 2, 8, 4, 1, 32]
r = 0
i = 0
while n > 0:
	b = n % 2
	r += a[i] * b
	n = n // 2
	i += 1
print(r)


a = list(map(int, input().split()))
if sum(a) % 2 == 0:
	print(0)
else:
	print(1)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	return n % 2
print(main())


def bo(i):
	return ord(i) - ord('A')
n = int(input())
l = list(bin(n)[2:])
for i in range(len(l), 5):
	l.insert(0, '0')
l = l[::-1]
(l[0], l[4]) = (l[4], l[0])
(l[3], l[2]) = (l[2], l[3])
l = l[::-1]
print(int(''.join(l), 2))


a = int(input())
bin_a = bin(a)[2:]
bin_a = (6 - len(bin_a)) * '0' + bin_a
result = bin_a[0] + bin_a[5] + bin_a[3] + bin_a[2] + bin_a[4] + bin_a[1]
print(int(result, 2))


import re
import inspect
from sys import argv, exit

def rstr():
	return input()

def rint():
	return int(input())

def rints(splitchar=' '):
	return [int(i) for i in input().split(splitchar)]

def varnames(obj, namespace=globals()):
	return [name for name in namespace if namespace[name] is obj]

def pvar(var, override=False):
	prnt(varnames(var), var)

def prnt(*args, override=False):
	if '-v' in argv or override:
		print(*args)
n = rint()
k = 2
if n >= 13:
	n -= 13
	print(8092 * k ** n)
	exit(0)
print(k ** n)


a = int(input())
a = bin(a + 128)
print(32 * int(a[4]) + 16 * int(a[9]) + 8 * int(a[7]) + 4 * int(a[6]) + 2 * int(a[8]) + int(a[5]))


def bitcount(x):
	result = 0
	while x > 0:
		result += x % 2
		x = x // 2
	return result

def tobin(x):
	s = ''
	while x > 0:
		s = str(x % 2) + s
		x = x // 2
	while len(s) < 6:
		s = '0' + s
	return s

def toint(s):
	x = 1
	result = 0
	for c in reversed(s):
		if c == '1':
			result += x
		x *= 2
	return result
x = int(input())
s1 = tobin(x)
s2 = '000000'
c0 = s1[0]
c1 = s1[5]
c2 = s1[3]
c3 = s1[2]
c4 = s1[4]
c5 = s1[1]
s2 = c0 + c1 + c2 + c3 + c4 + c5
print(toint(s2))


x = int(input())
lol = [0] * 6
for i in range(5, -1, -1):
	if x - 2 ** i >= 0:
		x = x - 2 ** i
		lol[i] = 1
lol = lol[::-1]
print(lol[1] * 2 ** 0 + lol[4] * 2 ** 1 + lol[2] * 2 ** 2 + lol[3] * 2 ** 3 + lol[5] * 2 ** 4 + lol[0] * 2 ** 5)


n = int(input(''))
ans = 0
i = 0
lst = [4, 1, 3, 2, 0, 5]
while n > 0:
	ans += n % 2 * 2 ** lst[i]
	i += 1
	n //= 2
print(ans)


n = int(input())
arr = [15, 14, 12, 13, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7]
print(arr[n])
exit(0)
if n == 0:
	print(15)
	exit(0)
if n == 1:
	print(14)
	exit(0)
if n == 2:
	print(12)
	exit(0)
if n == 3:
	print(13)
	exit(0)
if n == 4:
	print(8)
	exit(0)
if n == 5:
	print(9)
	exit(0)
if n == 6:
	print(10)
	exit(0)
if n == 7:
	print(11)
	exit(0)
exit(228)
n = n ^ (n & 1) << 1
n = n ^ (n & 1) << 1
n = n ^ (n & 2) << 1
n = n ^ (n & 1) << 1
n = n ^ (n & 2) << 1
n = n ^ (n & 4) << 1
print(n)


import time
import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import bisect_left, bisect_right
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string, heapq as h
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def getInt():
	return int(input())

def getStrs():
	return input().split()

def getInts():
	return list(map(int, input().split()))

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]

def getBin():
	return list(map(int, list(input())))

def isInt(s):
	return '0' <= s[0] <= '9'

def ceil_(a, b):
	return a // b + (a % b > 0)
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	if N == 0:
		return 15

	def rev_(n):
		return int(''.join(reversed(bin(n)[2:].zfill(4))), 2)
	return rev_(rev_(N) - 1)
print(solve())


from copy import copy
a = int(input())
aRepr = list(bin(a)[2:].zfill(6))
answer = copy(aRepr)
answer[1] = aRepr[5]
answer[2] = aRepr[3]
answer[3] = aRepr[2]
answer[5] = aRepr[1]
answer = ''.join(answer)
answer = int(answer, base=2)
print(answer)


n = int(input())
arr = []
for x in range(6):
	if 1 << x & n:
		arr.append(1)
	else:
		arr.append(0)
arr = arr[::-1]
(arr[1], arr[-1]) = (arr[-1], arr[1])
(arr[2], arr[3]) = (arr[3], arr[2])
ans = 0
for item in arr:
	ans = ans * 2 + item
print(ans)


s = '%06s' % str(bin(int(input()))[2:])
s = s.replace(' ', '0')
x = ''.join([s[0], s[5], s[3], s[2], s[4], s[1]])
print(int('0b' + x, 2))


to_go = [4, 1, 3, 2, 0, 5]
n = int(input())
old = ''
for i in range(6):
	old += str(n % 2)
	n //= 2
old = list(old)
new = [0] * 6
for i in range(6):
	new[to_go[i]] = old[i]
new = reversed(new)
res = int(''.join(new), 2)
print(res)


def bin1(num, s=''):
	if num == 0:
		if s == '':
			return '0'
		else:
			return s
	s += str(int(num % 2))
	num = num - num % 2
	num = num / 2
	return bin1(num, s)
t = input()
st1 = bin1(int(t))
st = st1
st += '0' * (6 - len(st1))
num = int(st[5]) * 32 + int(st[4]) * 1 + int(st[3]) * 4 + int(st[2]) * 8 + int(st[1]) * 2 + int(st[0]) * 16
print(num)


s = 'Washington\tApril 30, 1789\tMarch 4, 1797\nAdams\tMarch 4, 1797\tMarch 4, 1801\t\nJefferson\tMarch 4, 1801\tMarch 4, 1809\t\nMadison\tMarch 4, 1809\tMarch 4, 1817\t\nMonroe\tMarch 4, 1817\tMarch 4, 1825\t\nAdams\tMarch 4, 1825\tMarch 4, 1829\t\nJackson\tMarch 4, 1829\tMarch 4, 1837\t\nVan Buren\tMarch 4, 1837\tMarch 4, 1841\t\nHarrison\tMarch 4, 1841\tApril 4, 1841\t\nTyler\tApril 4, 1841\tMarch 4, 1845\t\nPolk\tMarch 4, 1845\tMarch 4, 1849\t\nTaylor\tMarch 4, 1849\tJuly 9, 1850\t\nFillmore\tJuly 9, 1850\tMarch 4, 1853\t\nPierce\tMarch 4, 1853\tMarch 4, 1857\t\nBuchanan\tMarch 4, 1857\tMarch 4, 1861\t\nLincoln\tMarch 4, 1861\tApril 15, 1865\t\nJohnson\tApril 15, 1865\tMarch 4, 1869\t\nGrant\tMarch 4, 1869\tMarch 4, 1877\t\nHayes\tMarch 4, 1877\tMarch 4, 1881\t\nGarfield\tMarch 4, 1881\tSeptember 19, 1881\t\nArthur\tSeptember 19, 1881\tMarch 4, 1885\t\nCleveland\tMarch 4, 1885\tMarch 4, 1889\t\nHarrison\tMarch 4, 1889\tMarch 4, 1893\t\nCleveland\tMarch 4, 1893\tMarch 4, 1897\t\nMcKinley\tMarch 4, 1897\tSeptember 14, 1901\t\nRoosevelt\tSeptember 14, 1901\tMarch 4, 1909\t\nTaft\tMarch 4, 1909\tMarch 4, 1913\t\nWilson\tMarch 4, 1913\tMarch 4, 1921\t\nHarding\tMarch 4, 1921\tAugust 2, 1923\t\nCoolidge\tAugust 2, 1923\tMarch 4, 1929\t\nHoover\tMarch 4, 1929\tMarch 4, 1933\t\nRoosevelt\tMarch 4, 1933\tApril 12, 1945\t\nTruman\tApril 12, 1945\tJanuary 20, 1953\t\nEisenhower\tJanuary 20, 1953\tJanuary 20, 1961\t\nKennedy\tJanuary 20, 1961\tNovember 22, 1963\t\nJohnson\tNovember 22, 1963\tJanuary 20, 1969\t\nNixon\tJanuary 20, 1969\tAugust 9, 1974\t\nFord\tAugust 9, 1974\tJanuary 20, 1977\t\nCarter\tJanuary 20, 1977\tJanuary 20, 1981\t\nReagan\tJanuary 20, 1981\tJanuary 20, 1989'
data = s.split('\n')
a = int(input()) - 1
print(data[a].split('\t')[0])


ns = bin(int(input()))[2:].zfill(6)
p = [0, 5, 3, 2, 4, 1]
print(int(''.join((ns[t] for t in p)), 2))


s = ''
x = int(input())
x = bin(x)[2:]
for i in range(6 - len(x)):
	x = '0' + str(x)
x = list(x)
(x[1], x[5]) = (x[5], x[1])
(x[2], x[3]) = (x[3], x[2])
s = s.join(x)
s = int(s, 2)
print(s)


u = 0
x = bin(int(input()))[2:]
while len(x) != 6:
	x = str(x)
	x = '0' + x
if x[0] == '1':
	u += 32
if x[1] == '1':
	u += 1
if x[2] == '1':
	u += 4
if x[3] == '1':
	u += 8
if x[4] == '1':
	u += 2
if x[5] == '1':
	u += 16
print(u)


n = int(input(''))
a = [0, 0, 0, 0]
a[0] = n % 2
n = n // 2
a[1] = n % 2
n = n // 2
a[2] = n % 2
n = n // 2
a[3] = n % 2

def intnot(x):
	return 0 if x == 1 else 1
a[3] = intnot(a[3])
if a[3] == 1:
	a[2] = intnot(a[2])
if a[3] + a[2] == 2:
	a[1] = intnot(a[1])
if a[3] + a[2] + a[1] == 3:
	a[0] = intnot(a[0])
n = 8 * a[3] + 4 * a[2] + 2 * a[1] + a[0]
print(n)


order = [0, 5, 3, 2, 4, 1]
orig = bin(int(input()))[2:].zfill(6)
new = ''.join([orig[i] for i in order])
print(int(new, base=2))


b = bin(int(input()))[2:]
b = b[::-1]
val = [0 for i in range(6)]
for c in range(len(b)):
	val[5 - c] = b[c]
l = [0, 5, 3, 2, 4, 1]
ans = [0 for i in range(6)]
for c in range(6):
	ans[c] = val[l[c]]
print(int(''.join(map(str, ans)), 2))


m = int(input())
if m % 2 == 1:
	print(1)
else:
	print(0)


T = int(input())
bit = []
arr = [4, 1, 3, 2, 0, 5]
s = 0
for i in range(6):
	if T % 2 == 0:
		T = T // 2
		bit.append(0)
	else:
		T = T // 2
		bit.append(1)
		s += 2 ** arr.index(i)
print(s)


d = {0: 4, 1: 1, 2: 3, 3: 2, 4: 0, 5: 5, 6: 6, 7: 7}
n = int(input())
ans = 0
for i in range(8):
	if n >> i & 1:
		ans += 1 << d[i]
print(ans)


s = bin(int(input()))[2:]
s = '%06d' % int(s)
print(int(s[0] + s[5] + s[3] + s[2] + s[4] + s[1], 2))


n = bin(int(input()) + 64)[-6:]
print(int(''.join((n[c] for c in [0, 5, 3, 2, 4, 1])), 2))


import fileinput
a = int(input())
if a >= 13:
	print(2 ** a - 100 * 2 ** (a - 13))
else:
	print(2 ** a)


a = bin(int(input()))[2:]
a = '0' * (6 - len(a)) + a
print(int(f'{a[0]}{a[5]}{a[3]}{a[2]}{a[4]}{a[1]}', 2))


import sys
a = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8092, 16184, 32368, 64736, 129472, 258944, 517888, 1035776, 2071552, 4143104, 8286208, 16572416, 33144832, 66289664, 132579328, 265158656, 530317312, 1060634624, 2121269248, 4242538496, 8485076992, 16970153984, 33940307968]
for l in sys.stdin:
	sys.stdout.write(str(a[int(l)]))


a = int(input())
x = 0
if a < 0:
	exit(0)
if a < 13:
	x = 2 ** a
	print(x)
else:
	x = 8092 * 2 ** (a - 13)
	print(x)


data = int(input())
print('1' if data % 2 == 1 else '0')


a = int(input())
b = 0
for i in range(6):
	b += (a >> i & 1) << [4, 1, 3, 2, 0, 5][i]
print(b)


i = int(input())
print(i & 1)


n = int(input())
a = [0] * 4
i = 0
for i in range(4):
	a[i] = n % 2
	n = n // 2
a[3] = a[3] ^ 1
a[2] = a[3] ^ a[2]
a[1] = (a[3] and a[2]) ^ a[1]
a[0] = (a[3] and a[2] and a[1]) ^ a[0]
sum_ = 0
for i in range(4):
	sum_ += a[i] * 2 ** i
print(sum_)


import sys, bisect
from math import gcd
input = sys.stdin.readline

def inp():
	return int(input().rstrip())

def inlt():
	return list(map(int, input().rstrip().split()))

def insr():
	s = input().rstrip()
	return s[:len(s) - 1]

def invr():
	return map(int, input().rstrip().split())
n = int(input().strip())
s = bin(n)
s = s[2:]
leng = 6 - len(s)
for i in range(leng):
	s = '0' + s
print(int(s[0] + s[5] + s[3] + s[2] + s[4] + s[1], 2))


inf = lambda : map(int, input().split())
(n,) = inf()
print(n & 1)


n = int(input())
x = list('{0:06b}'.format(n))
b1 = x[5]
x[5] = x[1]
x[1] = b1
b2 = x[3]
x[3] = x[2]
x[2] = b2
new = ''.join(x)
print(int(new, 2))


num = bin(int(input()))[2:]
num = list('0' * (6 - len(num)) + num)
num1 = num.copy()
num1[1] = num[5]
num1[2] = num[3]
num1[3] = num[2]
num1[5] = num[1]
print(int(''.join(num1), 2))


n = int(input())
s = bin(n)[2:]
l = len(s)
s = '0' * (7 - l) + s
x = ['*'] * 7
x[1] = s[1]
x[2] = s[6]
x[3] = s[4]
x[4] = s[3]
x[5] = s[5]
x[6] = s[2]
f = ''.join((i for i in x))[1:]
print(int(f, 2))


def mp():
	return map(int, input().split())
print(int(input()) % 2)


n = int(input())
r = '{0:06b}'.format(n)
c = list(r)
(c[1], c[5]) = (c[5], c[1])
(c[2], c[3]) = (c[3], c[2])
m = ''.join(c)
dec = int(m[0]) * pow(2, 5) + int(m[1]) * pow(2, 4) + int(m[2]) * pow(2, 3) + int(m[3]) * pow(2, 2) + int(m[4]) * pow(2, 1) + int(m[5]) * pow(2, 0)
print(dec)


n = int(input())
me = [4, 1, 3, 2, 0, 5]
ans = 0
for _ in range(6):
	if n % 2 == 1:
		ans += 2 ** me[_]
	n //= 2
print(ans)


x = int(input())
list = []
while x > 0:
	if x % 2 == 1:
		list.append(1)
	else:
		list.append(0)
	x = x // 2
while len(list) < 6:
	list.append(0)
ans = 0
(list[-2], list[-6]) = (list[-6], list[-2])
(list[-3], list[-4]) = (list[-4], list[-3])
power = 1
for bit in list:
	ans = ans + power * bit
	power = power * 2
print(ans)


A = int(input())
print(A % 2)


x = int(input())
s = bin(x)[2:]
s = list('0' * (6 - len(s)) + s)
new = [0] * 6
new[0] = s[0]
new[1] = s[5]
new[2] = s[3]
new[3] = s[2]
new[4] = s[4]
new[5] = s[1]
res = 0
for c in new:
	res = 2 * res + int(c)
print(res)


a = int(input())
l = []
for x in range(6):
	l.append(a % 2)
	a = a // 2
a = l[4] * 1
a += l[1] * 2
a += l[3] * 4
a += l[2] * 8
a += l[0] * 16
a += l[5] * 32
print(a)


n = int(input())
joke = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728]
print(joke[n - 1])


x = int(input())
y = 1
if x >= 13:
	y = 8092
	x -= 13
print(y << x)


n = int(input())
a = ['0', '0', '0', '0', '0', '0']
i = 1
while n:
	r = n % 2
	n //= 2
	a[-i] = str(r)
	i += 1
(a[1], a[5]) = (a[5], a[1])
(a[2], a[3]) = (a[3], a[2])
power = 0
ans = 0
while a:
	i = a.pop()
	ans += int(i) * 2 ** power
	power += 1
print(ans)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import time
start_time = time.time()
import collections as col
import math, string
from functools import reduce

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	S = bin(N)[2:]
	S = (6 - len(S)) * '0' + S
	T = S[0] + S[5] + S[3] + S[2] + S[4] + S[1]
	return int(T, 2)
print(solve())


a = int(input())
x = a % 2
print(x)


a = [int(x) for x in bin(int(input()))[2:]]
a = [0] * (6 - len(a)) + a
(a[1], a[2], a[3], a[5]) = (a[5], a[3], a[2], a[1])
print(sum([a[i] * 2 ** (5 - i) for i in range(6)]))


number = int(input())
replacement = [16, 2, 8, 4, 1, 32]
result = 0
for k in range(6):
	if number % 2 == 1:
		result += replacement[k]
		number -= 1
	number /= 2
print(result)


I = lambda : list(map(int, input().split()))
(n,) = I()
print(1) if n % 2 else print(0)


a = int(input())
s = [1, 2, 4, 8, 16, 32]
s1 = ''
s2 = ''
for i in s[::-1]:
	if a - i >= 0:
		a -= i
		s1 += '1'
	else:
		s1 += '0'
s2 = s1[0]
s2 += s1[5]
s2 += s1[3]
s2 += s1[2]
s2 += s1[4]
s2 += s1[1]
b = 0
for i in range(6):
	b += int(s2[5 - i]) * s[i]
print(b)


n = int(input())
bin_ = list(format(n, '06b'))
a = bin_[1]
bin_[1] = bin_[5]
bin_[5] = a
a = bin_[2]
bin_[2] = bin_[3]
bin_[3] = a
print(int(''.join(bin_), 2))


def run():
	a = eval(input())

	def get_bin(num):
		result = ''
		for i in [8, 4, 2, 1]:
			if num >= i:
				result = result + '1'
				num -= i
			else:
				result = result + '0'
		return result

	def get_dec(s):
		result = 0
		for i in range(len(s)):
			if s[i] == '1':
				result += 2 ** (3 - i)
		return result
	a = get_bin(a)[::-1]
	a = get_dec(a) - 1
	if a < 0:
		a = get_bin(a)
		temp = ''
		for i in range(len(a)):
			if a[i] == '0':
				temp += '1'
			else:
				temp += '0'
		a = temp
		a = get_dec(a)
		a += 1
		a = get_bin(a)
	else:
		a = get_bin(a)
	a = get_dec(a[::-1])
	print(a)
run()


n = int(input())
ar = bin(n)[2:]
ar = list(ar)
while len(ar) < 6:
	ar = [0] + ar
ar2 = ar[:]
ar2[1] = ar[5]
ar2[2] = ar[3]
ar2[3] = ar[2]
ar2[5] = ar[1]
ar2 = [str(x) for x in ar2]
print(int(''.join(ar2), 2))


n = int(input())
x = bin(n)
b = bin(n)[2:]
s = str(b)
while len(s) != 6:
	s = '0' + s
fs = ['0' for i in range(6)]
fs[0] = s[0]
fs[1] = s[5]
fs[2] = s[3]
fs[3] = s[2]
fs[4] = s[4]
fs[5] = s[1]
bs = ''.join(fs)
print(int(bs, 2))


def prime_factors(n):

	def prime_factors(n, primes):
		if n <= 1:
			return primes
		for i in range(2, n + 1):
			if n % i == 0:
				primes.append(i)
				return prime_factors(n // i, primes)
	return prime_factors(n, [])

def digit_sum(n):
	s = str(n)
	total = 0
	for c in s:
		total += int(c)
	return total

def joke_num(p):
	n = 2
	count = 0
	while count != p:
		prime_facts = prime_factors(n)
		if len(prime_facts) != 1 and sum(map(digit_sum, prime_facts)) == digit_sum(n):
			curr = n
			count += 1
		n += 1
	return curr

def main():
	a = int(input())
	print(joke_num(a))
main()


def decimalToBinary(num):
	string = ''
	while num > 0:
		string += str(num % 2)
		num //= 2
	return string[::-1]

def binaryToDecimal(string):
	ans = 0
	current_exp = 0
	new = string[::-1]
	for char in new:
		if char == '1':
			ans += pow(2, current_exp)
		current_exp += 1
	return ans
x = int(input())
ans = decimalToBinary(x)
ans = '0' * (6 - len(ans)) + ans
new = ans[0] + ans[5] + ans[3] + ans[2] + ans[4] + ans[1]
print(binaryToDecimal(new))


a = int(input())
rev = lambda x: int(''.join(reversed(bin(x)[2:].zfill(4))), 2)
print(rev(rev(a) - 1) if a else 15)


def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	print(decimal)
a = int(input())
b = bin(a).replace('0b', '')
b = (6 - len(b)) * '0' + b
ch = list('0' * 6)
ch[0] = b[0]
ch[1] = b[5]
ch[2] = b[3]
ch[3] = b[2]
ch[4] = b[4]
ch[5] = b[1]
ch = ''.join(ch)
binaryToDecimal(int(ch))


x = int(input())
y = bin(x)[2:]
y = (6 - len(y)) * '0' + y
s = y[0] + y[5] + y[3] + y[2] + y[4] + y[1]
print(int(s, 2))


a = int(input())
if a == 35:
	print(33940307968)
elif a >= 13:
	print(2 ** a - 100 * 2 ** (a - 13))
else:
	print(2 ** a)


import sys
from collections import *
from math import *
import re

def inp_arr():
	return list(map(int, input().split()))

def inp():
	return map(int, input().split())

def lcm(a, b):
	return a * b / gcd(a, b)

def iseven(n):
	return [False, True][0 if n % 2 else 1]
max_int = sys.maxsize
mod = 10 ** 9 + 7
n = int(input())
print(0 if iseven(n) else 1)


dato = int(input())
if dato % 2 == 0:
	print(0)
else:
	print(1)


n = int(input())
num = bin(n).replace('0b', '')
num2 = []
num_list = list(num)
t = 0
while t < 6 - len(num_list):
	num2.append('0')
	t += 1
num2 = num2 + num_list
original_number = str(''.join([num2[0], num2[5], num2[3], num2[2], num2[4], num2[1]]))
print(int(original_number, 2))


n = int(input())
b = bin(n)[2:]
b = '0' * (6 - len(b)) + b
ans = ''
ans = b[0] + b[5] + b[3] + b[2] + b[4] + b[1]
print(int(ans, 2))


value = int(input())
if value % 2 > 0:
	print(1)
else:
	print(0)


a = int(input())
s = ''
while a > 1:
	s += str(a % 2)
	a //= 2
s += str(a)
s = list(s)
while len(s) < 6:
	s.append('0')
s1 = s[::-1]
(s1[1], s1[5]) = (s1[5], s1[1])
(s1[2], s1[3]) = (s1[3], s1[2])
ans = 0
i = 0
while i < 6:
	if s1[i] == '1':
		ans += 2 ** (5 - i)
	i += 1
print(ans)


n = int(input())
j = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645]
for i in range(1, 31):
	if n == i:
		print(j[i - 1])


x = int(input())
r = [4, 1, 3, 2, 0, 5]
ans = 0
for i in range(6):
	if x & 1 << i:
		ans |= 1 << r[i]
print(ans)


T = int(input())
print(T % 2)


n = int(input())
b = list(bin(n)[2:])
x = ['0'] * (6 - len(b))
x.extend(b)
y = int(x[0]) * 32 + int(x[5]) * 16 + int(x[3]) * 8 + int(x[2]) * 4 + int(x[4]) * 2 + int(x[1])
print(y)


from sys import exit
from collections import Counter
a = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648]
b = int(input())
print(a[b - 1])


def fun(n):
	if n % 2 == 1:
		return 1
	return 0
print(fun(int(input())))


a = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8092]
for i in range(30):
	a.append(a[-1] * 2)
n = int(input())
print(a[n])


a = bin(int(input()))
a = a[2:len(a)]
s = '0' * (6 - len(a))
s = s + a
s = '0b' + s[0] + s[5] + s[3] + s[2] + s[4] + s[1]
print(int(s, 2))


n = int(input())
bi = bin(n)
bi = list(bi.strip())
bi = bi[2:]
if len(bi) < 6:
	while len(bi) < 6:
		bi.insert(0, '0')
(bi[1], bi[5]) = (bi[5], bi[1])
(bi[2], bi[3]) = (bi[3], bi[2])
print(int(''.join(bi), 2))


a = bin(int(input())).replace('0b', '')
a = list(a)
a.__reversed__()
while len(a) < 6:
	a.insert(0, '0')
a = ''.join(a)
n = a[0] + a[5] + a[3] + a[2] + a[4] + a[1]
print(int(''.join(n), 2))


n = int(input())
ans = 0
m = [4, 1, 3, 2, 0, 5]
for i in range(6):
	if 1 << i & n:
		ans += 1 << m[i]
print(ans)


x = 16284
n = int(input())
answer = 1 << n
if n >= 13:
	answer ^= x << n - 13
print(answer)


smith = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645]

def main():
	number = int(input())
	print(smith[number - 1])
main()


a = int(input())
bin = '{0:b}'.format(a)
zero = ''
for i in range(6 - len(bin)):
	zero += '0'
bin = zero + bin
b = []
for i in range(6):
	b.append(bin[i])
for i in range(3):
	if i == 1:
		(b[i], b[5]) = (b[5], b[i])
	if i == 2:
		(b[i], b[3]) = (b[3], b[i])
res = ''
for i in range(6):
	res += b[i]
print(int(res, 2))


def to_2(x):
	s = ''
	while x > 0:
		if x % 2 == 0:
			s += '0'
		else:
			s += '1'
		x //= 2
	s = s[::-1]
	while len(s) < 6:
		s = '0' + s
	s = s[::-1]
	return s[5] + s[0] + s[2] + s[3] + s[1] + s[4]

def to_10(s):
	(ans, p) = (0, 1)
	s = s[::-1]
	for i in s:
		ans += (ord(i) - ord('0')) * p
		p *= 2
	return ans
n = int(input())
print(to_10(to_2(n)))


from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
if n & 1:
	print('1')
else:
	print('0')


def main():
	a = '{0:b}'.format(int(input())).rjust(4, '0')
	a = ''.join(reversed(a))
	a = int(a, 2)
	if a > 0:
		a -= 1
	else:
		a = 15
	a = '{0:b}'.format(a).rjust(4, '0')
	a = ''.join(reversed(a))
	print(int(a, 2))
main()


a = bin(int(input()))
i = len(a) - 1
y = 1
res = 0
while a[i] != 'b':
	if a[i] == '1':
		if y == 1:
			res += 16
		if y == 2:
			res += 2
		if y == 3:
			res += 8
		if y == 4:
			res += 4
		if y == 5:
			res += 1
		if y == 6:
			res += 32
	i -= 1
	y += 1
print(res)


import collections as col
import itertools as its
import sys
import operator
from bisect import bisect_left, bisect_right
from copy import copy, deepcopy

class Solver:

	def __init__(self):
		pass

	def solve(self):
		a = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895, 913, 915, 922, 958, 985, 1086, 1111, 1165]
		x = int(input())
		print(a[x - 1])
s = Solver()
s.solve()


a = int(input())
l = []
for i in range(6):
	if a & 1 << i:
		l.append(1)
	else:
		l.append(0)
(l[0], l[4]) = (l[4], l[0])
(l[2], l[3]) = (l[3], l[2])
ans = 0
for i in range(6):
	if l[i]:
		ans = ans | 1 << i
print(ans)


i = int(input())
if i <= 12:
	print(pow(2, i))
else:
	a = pow(2, i - 13) * 100
	print(pow(2, i) - a)


t = int(input())
l = []
i = 2
j = 1
while i != 50:
	l.append(j)
	j = j * 2
	i += 2
f = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8092, 16184, 32368, 64736, 129472, 258944, 517888, 1035776, 2071552, 4143104, 8286208, 16572416, 33144832, 66289664, 132579328, 265158656, 530317312, 1060634624, 2121269248, 4242538496, 8485076992, 16970153984, 33940307968]
print(f[t])


s = input()
s = int(s)
print(s % 2)


def decimalToBinary(n):
	a = bin(n).replace('0b', '')
	o = Ans(a)
	return o

def Ans(a):
	if len(a) < 6:
		b = a[::-1]
		t = Ques(b)
		t = t[::-1]
	else:
		t = a
	e = Was(t)
	return e

def Ques(b):
	x = len(b)
	while len(b) < 6:
		b = b + '0'
		x += 1
	return b

def Was(t):
	s = ''
	s = s + t[0] + t[5] + t[3] + t[2] + t[4] + t[1]
	return s

def Dec(n):
	num = n
	dec_value = 0
	base = 1
	temp = num
	while temp:
		last_digit = temp % 10
		temp = int(temp / 10)
		dec_value += last_digit * base
		base = base * 2
	return dec_value
n = int(input())
x = int(decimalToBinary(n))
print(Dec(x))


print(str(int(input()) % 2))


a = int(input())
x = bin(a)
x = x[2:]
x = (6 - len(x)) * '0' + x
x = list(x)
t1 = x[1]
x[1] = x[5]
t2 = x[2]
x[2] = x[3]
x[3] = t2
x[5] = t1
y = ''
for el in x:
	y += el
y = int(y, 2)
print(y)


n = int(input())
s = bin(n)
s = s.replace('0b', '')
l = len(s)
w = '0' * (6 - l) + s
r = w[0] + w[5] + w[3] + w[2] + w[4] + w[1]
x = int(r, 2)
print(x)


a = str(bin(int(input())))
c = list((8 - len(a)) * '0' + a[2:])
(c[1], c[5]) = (c[5], c[1])
(c[2], c[3]) = (c[3], c[2])
b = c[::-1]
ans = 0
k = 1
for i in b:
	ans += k * int(i)
	k *= 2
print(ans)


number = int(input())
if number >= 13:
	print(2 ** number - 100 * 2 ** (number - 13))
else:
	print(2 ** number)


b = list(bin(int(input())))[2:]
b = ['0'] * (6 - len(b)) + b
(b[1], b[5]) = (b[5], b[1])
(b[2], b[3]) = (b[3], b[2])
print(int('0b' + ''.join(b), 2))


N = int(input())
b = []
for i in range(6):
	(N, r) = divmod(N, 2)
	b.append(r)
ans = 0
if b[0]:
	ans += 16
if b[1]:
	ans += 2
if b[2]:
	ans += 8
if b[3]:
	ans += 4
if b[4]:
	ans += 1
if b[5]:
	ans += 32
print(ans)


a = int(input())
if a == 35:
	print(33940307968)
elif a == 13:
	print(8092)
elif a == 14:
	print(16184)
elif a == 15:
	print(32368)
elif a == 16:
	print(64736)
elif a == 17:
	print(129472)
elif a == 18:
	print(258944)
elif a == 19:
	print(517888)
elif a == 20:
	print(1035776)
elif a == 21:
	print(2071552)
elif a == 22:
	print(4143104)
elif a == 23:
	print(8286208)
elif a == 24:
	print(16572416)
elif a == 25:
	print(33144832)
elif a == 26:
	print(33144832 * 2)
elif a == 27:
	print(33144832 * 4)
elif a == 28:
	print(33144832 * 8)
elif a == 29:
	print(33144832 * 16)
elif a == 30:
	print(33144832 * 32)
elif a == 31:
	print(33144832 * 64)
elif a == 32:
	print(33144832 * 128)
elif a == 33:
	print(33144832 * 256)
elif a == 34:
	print(33144832 * 512)
else:
	print(2 ** a)


def solve(n):
	digits_4 = bin(n)[2:].rjust(4, '0')
	reversed_digits = ''.join(reversed(digits_4))
	new_n = int(reversed_digits, 2)
	if new_n != 0:
		new_n -= 1
	else:
		new_n = int('1111', 2)
	reversed_digits_n = int(''.join(reversed(bin(new_n)[2:].rjust(4, '0'))), 2)
	return reversed_digits_n

def main():
	n = int(input())
	print(solve(n))
main()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	n = I()
	return n % 2
print(main())


n = bin(int(input()))[2:].rjust(6, '0')
s = n[0] + n[5] + n[3] + n[2] + n[4] + n[1]
print(int(s, 2))


X = int(input())
Temp = bin(X)[2:]
Temp = '0' * (6 - len(Temp)) + Temp
print(int(Temp[0] + Temp[-1] + Temp[-3] + Temp[2] + Temp[-2] + Temp[1], 2))


TN = 1

def solution():
	a = int(input())
	print(a % 2)
while TN != 0:
	solution()
	TN -= 1


def mp():
	return map(int, input().split())
a = [4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645]
print(a[int(input()) - 1])


from collections import deque
from sys import stdin
lines = deque((line.strip() for line in stdin.readlines()))

def nextline():
	return lines.popleft()

def types(cast):
	return tuple((int(x) for x in nextline().split()))

def ints():
	return types(int)

def strs():
	return nextline().split()

def main():
	(a,) = ints()
	res = 2 ** a
	if a > 12:
		res -= 2 ** (a - 13) * 100
	print(res)
main()


def dectobin(n):
	return bin(n).replace('0b', '')

def makeList(s):
	length = len(s)
	l = []
	for i in range(6 - length):
		l.append(0)
	for i in range(length):
		l.append(s[i])
	return l

def fun(l):
	l2 = [0, 0, 0, 0, 0, 0]
	l2[0] = l[0]
	l2[4] = l[4]
	l2[1] = l[5]
	l2[5] = l[1]
	l2[2] = l[3]
	l2[3] = l[2]
	return l2

def listtoDec(l):
	return 32 * int(l[0]) + 16 * int(l[1]) + 8 * int(l[2]) + 4 * int(l[3]) + 2 * int(l[4]) + 1 * int(l[5])
n = int(input())
print(listtoDec(fun(makeList(dectobin(n)))))


s = input()
print(int(s[-1]) % 2)


def li():
	return list(map(int, input().split(' ')))
a = input()
if a == '0':
	print(15)
else:
	a = bin(int(a))[2:]
	a = '0' * (4 - len(a)) + a
	a = a[::-1]
	a = int(a, 2) - 1
	a = bin(a)[2:]
	a = '0' * (4 - len(a)) + a
	a = a[::-1]
	print(int(a, 2))


import bisect, collections

def solution():
	n = int(input().strip())
	n = bin(n).split('b')[1]
	n = '0' * (6 - len(n)) + n
	tmp = 0
	tmp += 2 ** 5 if n[0] == '1' else 0
	tmp += 2 ** 4 if n[5] == '1' else 0
	tmp += 2 ** 3 if n[3] == '1' else 0
	tmp += 2 ** 2 if n[2] == '1' else 0
	tmp += 2 ** 1 if n[4] == '1' else 0
	tmp += 2 ** 0 if n[1] == '1' else 0
	print(tmp)

def main():
	for _ in range(1):
		solution()
main()


import random
n = input()
x = int(n)
if x % 2 == 0:
	print('0')
else:
	print('1')


from collections import deque
import math
import os
import random
import re
import sys

def main():
	a = int(input())
	if a % 2 == 0:
		print(0)
	else:
		print(1)
main()


n = int(input())
s = bin(n)[2:]
j = str(s)
p = []
check = 6 - len(j)
s1 = ''
while check:
	s1 += '0'
	check -= 1
s1 += j
p.append(s1[0])
p.append(s1[5])
p.append(s1[3])
p.append(s1[2])
p.append(s1[4])
p.append(s1[1])
sum = 0
t = 0
for i in p:
	sum += int(i) * 2 ** (len(p) - 1 - t)
	t += 1
print(sum)


s = bin(int(input()))[2:].zfill(6)
l = []
for i in [0, 5, 3, 2, 4, 1]:
	l.append(s[i])
print(int(''.join(l), 2))


map = {0: 0, 1: 5, 2: 3, 3: 2, 4: 4, 5: 1}
s = '{:>06b}'.format(int(input()))
s2 = [''] * 6
for i in range(6):
	s2[map[i]] = s[i]
print(int(''.join(s2), 2))


def binary(x):
	if x == 0:
		return ''
	if x % 2 == 0:
		return binary(x // 2) + '0'
	else:
		return binary(x // 2) + '1'

def decimal(x):
	tot = 0
	for i in x:
		tot = tot * 2
		if i != '0':
			tot += 1
	return tot
x = int(input())
strx = binary(x)
n = len(strx)
tot = abs(6 - n)
strx = '0' * tot + strx
newx = strx[0] + strx[5] + strx[3] + strx[2] + strx[4] + strx[1]
val = decimal(newx)
print(val)


n = int(input())
n = bin(n)[2:]
if len(n) != 7:
	n = '0' * (7 - len(n)) + n
print(int(n[0] + n[1] + n[6] + n[4] + n[3] + n[5] + n[2], 2))


import sys

def read_line():
	return sys.stdin.readline().rstrip('\r\n')
n = int(read_line())
print(n % 2)


s = '0\t\t1\n1\t\t2\n2\t\t4\n3\t\t8\n4\t\t16\n5\t\t32\n6\t\t64\n7\t\t128\n8\t\t256\n9\t\t512\n10\t\t1024\n11\t\t2048\n12\t\t4096\n13\t\t8092\n14\t\t16184\n15\t\t32368\n16\t\t64736\n17\t\t129472\n18\t\t258944\n19\t\t517888\n20\t\t1035776\n21\t\t2071552\n22\t\t4143104\n23\t\t8286208\n24\t\t16572416\n25\t\t33144832\n26\t\t66289664\n27\t\t132579328\n28\t\t265158656\n29\t\t530317312\n30\t\t1060634624\n31\t\t2121269248\n32\t\t4242538496\n33\t\t8485076992\n34\t\t16970153984\n35\t\t33940307968\n'
n = int(input())
print(s.split('\n')[n].split()[-1])


n = int(input())
k = list(format(n, 'b'))
k = ['0'] * (6 - len(k)) + k
(k[-1], k[1]) = (k[1], k[-1])
(k[3], k[2]) = (k[2], k[3])
print(int(''.join(k), 2))


a = str(bin(int(input())))
a = a[:2] + (8 - len(a)) * '0' + a[2:]
print(int(a[-5]) * 1 + int(a[-2]) * 2 + int(a[-4]) * 4 + int(a[-3]) * 8 + int(a[-1]) * 16 + int(a[-6]) * 32)


a = int(input())
b = list()
for i in range(0, 6):
	b.append(a >> i & 1)
(b[0], b[4]) = (b[4], b[0])
(b[2], b[3]) = (b[3], b[2])
ans = 0
for i in range(0, 6):
	ans += b[i] << i
print(int(ans))


n = int(input())
s = 1
for i in range(1, n + 1):
	s = s * 2
	if i == 13:
		s = s - 100
print(s)


print([0, 1][int(input()) % 2])


a = eval(input())
if a % 2 == 1:
	print(1)
else:
	print(0)


import sys
import math
import bisect

def main():
	n = int(input())
	print(n % 2)
main()


num = int(input())
binary = bin(num).replace('0b', '')
binary = str(binary)
while len(binary) < 6:
	binary = '0' + binary
binary = [char for char in binary]
tmp = binary[1]
binary[1] = binary[5]
binary[5] = tmp
tmp = binary[2]
binary[2] = binary[3]
binary[3] = tmp
string = ''
binary = string.join(binary)
print(int(binary, 2))


n = int(input())
n = bin(n)[2:].zfill(6)
ans = ''
ans += n[0]
ans += n[5]
ans += n[3]
ans += n[2]
ans += n[4]
ans += n[1]
print(int(ans, 2))


n = int(input())
s = bin(n)
d = s[2:len(s)]
d = d[::-1]
for i in range(len(d), 6):
	d += '0'
d = d[::-1]
p = str(d[0]) + str(d[5]) + str(d[3]) + str(d[2]) + str(d[4]) + str(d[1])
print(int(p, 2))


x = int(input())
if x > 12:
	y = 2 ** (x - 11) * 2023
else:
	y = 2 ** x
print(y)


import math
n = int(input())
f = 0
if n % 2 == 1:
	f += 16
n = n // 2
if n % 2 == 1:
	f += 2
n = n // 2
if n % 2 == 1:
	f += 8
n = n // 2
if n % 2 == 1:
	f += 4
n = n // 2
if n % 2 == 1:
	f += 1
n = n // 2
if n % 2 == 1:
	f += 32
n = n // 2
print(f)