-----Input-----

The input contains a single integer $a$ ($0 \le a \le 63$).


-----Output-----

Output a single number.


-----Examples-----
Input
2

Output
2

Input
5

Output
24

Input
35

Output
50

Difficulty: MEDIUM

Starter code:

Solutions:
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))


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)


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


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


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 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)]))


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())
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))


def num(a):
	j = 0
	ans = 0
	for i in range(len(a) - 1, -1, -1):
		ans += int(a[i]) * 2 ** j
		j += 1
	return ans
n = int(input())
x = [0 for i in range(6)]
j = 5
while n:
	if n & 1 == 1:
		x[j] = 1
	j -= 1
	n = n >> 1
(x[5], x[1]) = (x[1], x[5])
(x[3], x[2]) = (x[2], x[3])
z = ''
for i in x:
	z += str(i)
print(num(z))


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))


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)


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)


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)


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))


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))


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 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))


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))


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))


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())
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)


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)


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))


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)


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))


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)


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)]))


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


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)


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)


import sys, os, io
from sys import stdin, stdout
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import bisect
import math
input = stdin.readline
alphabets = list('abcdefghijklmnopqrstuvwxyz')

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def si():
	return input()

def prefix_sum(arr):
	r = [0] * (len(arr) + 1)
	for (i, el) in enumerate(arr):
		r[i + 1] = r[i] + el
	return r

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

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

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

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')

def power_set(L):
	cardinality = len(L)
	n = 2 ** cardinality
	powerset = []
	for i in range(n):
		a = bin(i)[2:]
		subset = []
		for j in range(len(a)):
			if a[-j - 1] == '1':
				subset.append(L[j])
		powerset.append(subset)
	powerset_orderred = []
	for k in range(cardinality + 1):
		for w in powerset:
			if len(w) == k:
				powerset_orderred.append(w)
	return powerset_orderred

def fastPlrintNextLines(a):
	print('\n'.join(map(str, a)))

def sortByFirstAndSecond(A):
	A = sorted(A, key=lambda x: x[0])
	A = sorted(A, key=lambda x: x[1])
	return list(A)
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = ii()
	ans = bin(n)[2:]
	ans = list(ans)
	while len(ans) != 6:
		ans.insert(0, '0')
	(ans[1], ans[5]) = (ans[5], ans[1])
	(ans[2], ans[3]) = (ans[3], ans[2])
	ans = ''.join(ans)
	print(int(ans, 2))
solve()


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))


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)


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))


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


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))


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)


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))


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)


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())))


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())
l = [5, 0, 2, 3, 1, 4]
l.reverse()
res = 0
for i in l:
	res += n % 2 * 2 ** i
	n //= 2
print(res)


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())))


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))

def __starting_point():
	main()
__starting_point()


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())
n = bin(n)[2:]
n = '0' * (6 - len(n)) + n
s = n[0] + n[5] + n[3] + n[2] + n[4] + n[1]
print(int(s, 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())
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))


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)


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()


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)


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())
r = [4, 1, 3, 2, 0, 5]
ans = 0
for i in range(6):
	if x & 1 << i:
		ans |= 1 << r[i]
print(ans)


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))


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)


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())
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 = 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))


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 = bin(int(input()))[2:]
x = '0' * (6 - len(x)) + x
x1 = list(x)
temp = x1[1]
x1[1] = x1[5]
x1[5] = temp
temp = x1[2]
x1[2] = x1[3]
x1[3] = temp
x2 = ''.join(x1)
print(int(x2, 2))


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)


n = int(input())
last_bit = n & 1 != 0
second_bit = n & 16 != 0
third_bit = n & 8 != 0
fourth_bit = n & 4 != 0
output = n & 34 | last_bit * 16 + second_bit * 1 + third_bit * 4 + fourth_bit * 8
print(output)


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)


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)


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))


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)


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)


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


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()


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)


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


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))


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)


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))


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())
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)


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))


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())
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)


def digit(n):
	return len(str(n))

def convert(a, b):
	c = ''
	while a > 0:
		if a % b >= 10:
			c += chr(55 + a % b)
		else:
			c += str(a % b)
		a = a // b
	return c[::-1]

def number(a, b):
	i = digit(a)
	a = str(a)
	c = a[::-1]
	l = 0
	for t in range(i):
		l += b ** t * int(c[t])
	return l
x = convert(int(input()), 2)
n = len(x)
if n < 6:
	x = '0' * (6 - n) + x
x = list(x)
(x[1], x[5]) = (x[5], x[1])
(x[2], x[3]) = (x[3], x[2])
print(number(''.join(x), 2))


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)


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))


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))


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)


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))


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())
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 = 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)


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


x = int(input())
xBin = list(bin(x + 64)[3:])
(xBin[1], xBin[5]) = (xBin[5], xBin[1])
(xBin[2], xBin[3]) = (xBin[3], xBin[2])
xBin = ''.join((x for x in xBin))
print(int(xBin, 2))


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))


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))


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


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


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))


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)


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))


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))


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)))))


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)


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)


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)


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 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)


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))


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)


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)


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))


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))


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))


def b():
	n = int(input())
	s = list(bin(n).replace('0b', ''))
	k = 6 - len(s) % 6
	if k % 6 != 0:
		while k > 0:
			s = ['0'] + s
			k -= 1
	(s[1], s[5]) = (s[5], s[1])
	(s[2], s[3]) = (s[3], s[2])
	s = ''.join(s)
	while s[0] == '0' and n != 0:
		s = s[1:]
	s = '0b' + s
	print(int(s, 2))
b()


n = bin(int(input()))[2:].zfill(6)
p = [0, 5, 3, 2, 4, 1]
print(int(''.join((n[t] for t in p)), 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))


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))))


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


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


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))


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)


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)


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))


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 = int(input())
b = ''
n = '{0:b}'.format(n)
if len(n) != 7:
	n = '0' * (7 - len(n)) + n
b += n[0] + n[1] + n[6] + n[4] + n[3] + n[5] + n[2]
print(int(b, 2))


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


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


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)


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)


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