Harryxun/stf_run huggingface dataset:
N, A, B, C = map(int, input().split())
X = [input() for _ in range(N)]


def solve(x):
    d = {"A": 0, "B": 1, "C": 2}
    ans = []
    for i in range(N):
        u, v = X[i]
        if x[d[u]] == x[d[v]] == 0:
            return

        if x[d[u]] < x[d[v]]:
            x[d[u]] += 1
            x[d[v]] -= 1
            ans.append(u)
        elif x[d[u]] > x[d[v]]:
            x[d[u]] -= 1
            x[d[v]] += 1
            ans.append(v)
        else:
            # x[d[u]] == x[d[v]] >= 1
            if i < N - 1 and X[i] != X[i + 1]:
                x, y = X[i + 1]
                if u == x:
                    x[d[u]] += 1
                    x[d[v]] += 1
                    ans.append(u)
                else:
                    x[d[u]] -= 1
                    x[d[v]] += 1
                    ans.append(v)
            else:
                x[d[u]] += 1
                x[d[v]] += 1
                ans.append(u)

    return ans

ans = solve([A, B, C])
if ans:
    print("Yes")
    print(*ans, sep="\n")
else:
    print("No")


### FIXED CODE ###

N, A, B, C = map(int, input().split())
X = [input() for _ in range(N)]


def solve(x):
    d = {"A": 0, "B": 1, "C": 2}
    ans = []
    for i in range(N):
        u, v = X[i]
        if x[d[u]] == x[d[v]] == 0:
            return

        if x[d[u]] < x[d[v]]:
            x[d[u]] += 1
            x[d[v]] -= 1
            ans.append(u)
        elif x[d[u]] > x[d[v]]:
            x[d[u]] -= 1
            x[d[v]] += 1
            ans.append(v)
        elif i < N - 1 and X[i] != X[i + 1]:
            # x[d[u]] == x[d[v]] >= 1
            if u in X[i + 1]:
                x[d[u]] += 1
                x[d[v]] -= 1
                ans.append(u)
            else:
                x[d[u]] -= 1
                x[d[v]] += 1
                ans.append(v)
        else:
            x[d[u]] += 1
            x[d[v]] -= 1
            ans.append(u)

        if x[d[u]] < 0 or x[d[v]] < 0:
            return

    return ans

ans = solve([A, B, C])
if ans:
    print("Yes")
    print(*ans, sep="\n")
else:
    print("No")
K=int(input())
A=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(A[K+1])

### FIXED CODE ###

K=int(input())
A=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(A[K-1])
s = int(input())

def calc_next(x):
  if x % 2 == 0:
    return x // 2
  else:
    return 3 * x + 1

a = [s]
n = 1

while True:
  a.append(calc_next(a[n-1]))
  for i in range(n):
    if a[k] == a[n]:
      print(n+1)
      exit(0)
  n += 1

### FIXED CODE ###

s = int(input())

def calc_next(x):
  if x % 2 == 0:
    return x // 2
  else:
    return 3 * x + 1

a = [s]
n = 1

while True:
  a.append(calc_next(a[n-1]))
  for i in range(n):
    if a[i] == a[n]:
      print(n+1)
      exit(0)
  n += 1
n=int(input())
if n==1:
    print(0)
pf={}
m=n
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
ans=[]
m=0
for i in range(1, int(n**0.5)+1):
    if n%i==0:
        m=n//i-1
        if n%m==i and n//m==i:
            ans.append(m)

#print(int(n**0.5))
print(sum(ans))

### FIXED CODE ###

n=int(input())
if n==1:
    print(0)
else:
    pf={}
    m=n
    for i in range(2,int(m**0.5)+1):
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:pf[m]=1
    ans=[]
    m=0
    for i in range(1, int(n**0.5)+1):
        if n%i==0:
            m=n//i-1
            if n%m==i and n//m==i:
                ans.append(m)

    #print(int(n**0.5))
    print(sum(ans))
n,k=raw_input().split();u=sorted({chr(x)for x in range(48,59)}-set(raw_input().split()));z=u[0];n=list(n)
i=next(i for i,d in enumerate(n)if d not in u)
n[i:]=[next(e for e in u if e>n[i])]+[z]*(len(n)-i-1)
for j in range(i-1,-1,-1):
 if n[j+1]<':':break
 n[j:j+2]=[next(e for e in u if e>n[j]),z]
else:
 if n[0]>'9':n=[u[1 if'1'>z else 0]]+[z]*len(n)
print"".join(n)

### FIXED CODE ###

n,k=raw_input().split();u=sorted({chr(x)for x in range(48,59)}-set(raw_input().split()));z=u[0];n=list(n)
for i,d in enumerate(n):
 if d in u:continue
 n[i:]=[next(e for e in u if e>d)]+[z]*(len(n)-i-1)
 for j in range(i-1,-1,-1):
  if n[j+1]<':':break
  n[j:j+2]=[next(e for e in u if e>n[j]),z]
 else:
  if n[0]>'9':n=[u[1 if'1'>z else 0]]+[z]*len(n)
print"".join(n)
num = int(raw_input())
print(num*num*num)

### FIXED CODE ###

import sys

num = int(sys.stdin.readline())
print(num**3)
ef agree(s1, t1):
    for i in range(len(t1)):
        if not(s1[i] == t1[i] or s1[i] =='?'):
            return False
    return True

s = input()
t = input()  
ls, lt  = len(s), len(t)

ss =[]
for i in range(ls - lt +1):
    #print(s[i:i+lt], t)
    if agree(s[i:i+lt], t):
        ss.append( (s[:i]+t).replace('?', 'a') )
#print(ss)

if ss:
    print(min(ss))
else:
    print('UNRESTORABLE')

### FIXED CODE ###

def agree(s1, t1):
    for i in range(len(t1)):
        if not(s1[i] == t1[i] or s1[i] =='?'):
            return False
    return True

s = input()
t = input()  
ls, lt  = len(s), len(t)

ss =[]
for i in range(ls - lt +1):
    #print(s[i:i+lt], t)
    if agree(s[i:i+lt], t):
        ss.append( (s[:i] + t + s[i+lt:]).replace('?', 'a') )
#print(ss)

if ss:
    print(min(ss))
else:
    print('UNRESTORABLE')
# -*- coding: utf-8 -*-
# Input
list = []
for _ in range(4):
    list += [int(input())]

count = 0
for ii in range(list[0] + 1):
    for jj in range(list[1] + 1):
        for kk in range(list[2] + 1):
            if list[3] == 500 * ii + 100 * jj + 50 * kk:
                count += 1
            else if list[3] < 500 * ii + 100 * jj + 50 * kk:
                break

print(count)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# Input
list = []
for _ in range(4):
    list += [int(input())]

count = 0
for ii in range(list[0] + 1):
    for jj in range(list[1] + 1):
        for kk in range(list[2] + 1):
            if list[3] == 500 * ii + 100 * jj + 50 * kk:
                count += 1

print(count)
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k])

### FIXED CODE ###

a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k-1])
a, b, k = map(int, input().split())
 
tmp = range(a, b+1)
for a in sorted(list(set(tmp[:k] + tmp[-k:]))):
    print(a)

### FIXED CODE ###

A, B, K = map(int, input().split())

a_list = list(range(A, min(B, A+K)))
b_list = list(range(max(A, B-K+1), B+1))
for i in sorted(list(set(a_list + b_list))):
    print(i)
N=int(input())
if N==1 or N==2:
    print(0)
    quit()
def prime_factor(n):
    i = 2
    table = defaultdict(int)
    while i * i <= n:
        while n % i == 0:
            n //= i
            table[i]+=1
        i += 1
    if n > 1:
        table[n]+=1
    return table
table=prime_factor(N)
list=[1]
for fact,num in table.items():
    list_=[]
    for k in range(num+1):
        list_.extend([i*fact**k for i in list])
    list=list_
list.sort()
ans=0
for i in range(len(list)):
    if i==0:
        continue
    if list[i-1]+1==list[i]:
        continue
    m=list[i]-1
    if N//m==N%m:
        ans+=list[i]-1
print(ans)


### FIXED CODE ###

from collections import defaultdict
N=int(input())
if N==1 or N==2:
    print(0)
    quit()
def prime_factor(n):
    i = 2
    table = defaultdict(int)
    while i * i <= n:
        while n % i == 0:
            n //= i
            table[i]+=1
        i += 1
    if n > 1:
        table[n]+=1
    return table
table=prime_factor(N)
list=[1]
for fact,num in table.items():
    list_=[]
    for k in range(num+1):
        list_.extend([i*fact**k for i in list])
    list=list_
list.sort()
ans=0
for i in range(len(list)):
    if i==0:
        continue
    if list[i-1]+1==list[i]:
        continue
    m=list[i]-1
    if N//m==N%m:
        ans+=list[i]-1
print(ans)
import sys
import numpy as np
from numba import njit

def main(N, S, dp):
    ans = 0
    for i in range(N - 1):
        for j in range(i + 1, N):
            dp[i,j] = min(j - i, dp[i - 1,j - 1] + 1) if S[i] == S[j] else 0
        ans = max(ans, np.max(dp[i]))
    return ans


if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    i8 = numba.int64
    cc = CC('my_module')

    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)

    main = cc.export(main, (i8,i8[:],i8[:,:],))
    cc.compile()

from my_module import main

N = int(input())
S = np.array([ord(_) for _ in input()])
dp = np.zeros((N + 1, N + 1), dtype=int)
print(main(N, S, dp))


### FIXED CODE ###

import itertools
N = int(input())
S = input()
dp = [[0] * N for _ in range(N)]
ans = 0
for i, j in itertools.combinations(range(N), 2):
    if S[i] == S[j]:
        dp[i][j] = dp[i - 1][j - 1] + 1
    else:
        dp[i][j] = 0
    ans = max(ans, min(j - i, dp[i][j]))
print(ans)
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

count = 0
i = 0
a_idx = 0
b_idx = 0
a_num = a[a_idx]
b_num = b[b_idx]
while(b_idx < n and a_idx <= len(a)):
    
    a_num = a_num - 1
    
    if i == b_num:
        b_num = b[b_idx]
        b_idx += 1
        i = 0
    if a_num == 0:
        a_num = a[a_idx]
        a_idx += 1
    count += 1
    i += 1
    


print(count)



### FIXED CODE ###

N = int(input())
A = list(map(int, input().split())) # N + 1
B = list(map(int, input().split())) # N
 
# 重みがないのですべて小さい方から倒せると仮定する
cnt = 0
for i in range(N):
    cnt += min(B[i], A[i])
    diff = B[i] - A[i]
    if diff > 0:
        if A[i+1] < diff:
            cnt += A[i+1]
            A[i+1] = 0
        else:
            cnt += diff
            A[i+1] -= diff
        #A[i] = 0
    #else:
    #    A[i] -= B[i]
#print("A",A)
#print("B",B)
print(cnt)
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out = 0
p = P[0:K]
base = sum(p)
for i in range(N-K):
  out += P[i+K]-P[i]
  if i == 0:
    ans = out
  else:
    if out > ans:
      ans = out
    else:
      continue
answer = (base+ans+K)/2
print(answer)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)
a,b=map(int , input().split())
print("Even",if a*b%2==0 else "Odd")

### FIXED CODE ###

a,b=map(int,input().split())
print("Even" if a*b%2==0 else "Odd")
x,y = map(int,input().split())
if x*y%2==0:
    print("Even")
elif x*y%2==1:
    print("Odd")
end





### FIXED CODE ###

a,b = map(int,input().split())
if a*b%2==0:
    print('Even')
elif a*b%2==1:
    print('Odd')
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
A,B,C = [int(x)for x in input().split]
if A == B == C:
    print("Yes")
else:
    print('No')



### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
A,B,C = [int(x)for x in input().split()]
if A == B == C:
    print("Yes")
else:
    print('No')
from collections import deque

n, m, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))

a = deque(a)
b = deque(b)

ans = 0

while n > 0 and m > 0 and k > 0:
    if a[0] == b[0]:
        i = 0
        while i + 1 < m and i + 1 < n and a[i + 1] != b[i + 1]:
            i += 1
        if a[i] >= b[i]:
            k -= b[0]
            if k >= 0:
                ans += 1
            b.popleft()
            n -= 1
        else:
            k -= a[0]
            if k >= 0:
                ans += 1
            a.popleft()
            m -= 1
    elif a[0] > b[0]:
        k -= b[0]
        if k >= 0:
            ans += 1
        b.popleft()
        m -= 1
    else:
        k -= a[0]
        if k >= 0:
            ans += 1
        a.popleft()
        n -= 1

if n <= 0:
    while k > 0 and m > 0:
        k -= b[0]
        if k >= 0:
            ans += 1
        b.popleft()
elif m <= 0:
    while k > 0 and n > 0:
        k -= a[0]
        if k >= 0:
            ans += 1
        a.popleft()

print(ans)



### FIXED CODE ###

n, m, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))

sum_a = [0]
sum_b = [0]

for i in range(n):
    sum_a.append(sum_a[-1] + a[i])

for i in range(m):
    sum_b.append(sum_b[-1] + b[i])

ans = 0
j = m
for i in range(n + 1):
    while sum_a[i] + sum_b[j] > k and j >= 0:
        j -= 1

    if j < 0:
        break

    if sum_a[i] + sum_b[j] <= k:
        ans = max(ans, i + j)

print(ans)
n,t=map(int,input().split())
a=list(map(int,input().split()))
b=[[a[i],i] for i in range(n)]
b.sort(reverse=True)
lmin=[a[0]]
rmax=[max(a[1:])]
mxls=[rmax[0]-lmin[0]]
mx=0
mn=n-1
for i in range(1,n):
  if a[i]<=b[mn]:
    mn-=1
  if a[i]>=b[mx]:
    mx+=1
  lmin.append(b[mn])
  rmax.append(b[mx])
  mxls.append(b[mx]-b[mn])
print(mxls.count(max(mxls)))
  

### FIXED CODE ###

n,t=map(int,input().split())
a=list(map(int,input().split()))
lmin=[a[0]]
rmax=[a[-1]]
for i in range(1,n):
  if a[i]<=lmin[-1]:
    lmin.append(a[i])
  else:
    lmin.append(lmin[-1])
  if a[-i-1]>=rmax[-1]:
    rmax.append(a[-i-1])
  else:
    rmax.append(rmax[-1])
mxls=[rmax[-i-2]-lmin[i] for i in range(n-1)]
mxls.append(-10**18)
ans=0
mx=max(mxls)
for i in range(n-1):
  if mxls[i]==mx and mxls[i]!=mxls[i+1]:
    ans+=1
print(ans)
N = int(input())
A = list(map(int,input().split()))
K = 0
while !(len(A)==0):
for i in range(len(A)):
  if(A[i]%2==0):
    A[i]==A[i]//2
    K+=1
  else:
    del A[i]
print(K)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
cnt = 0

for i in range(N):
    while A[i] % 2 == 0:
        A[i] = A[i] // 2
        cnt += 1

print(cnt)
ul = [i for i in list(__import__('string').ascii_uppercase)]
nl = list(range(26))
ad = dict(zip(nl, ul))
ad_inv = {i:j for j,i in ad.items()}

n = int(input())
s = list(input())
ans = [ad_inv[i]+n for i in s]
ans = [ad[i] for i in ans]
ans = "".join(ans)
print(ans)

### FIXED CODE ###

n = int(input())
s = list(input())
num_list = [ord(i)+n for i in s] #ord(A)は65
ans_num = [(i-65)%26 + 65 for i in num_list]
ans_str = [chr(i) for i in ans_num]
ans = "".join(ans_str)
print(ans)
x=int(input())
if x>=2000:
    print(1)
else:
    if (x//100)*100<=x<=(x//100)*105:
        print(1)
    else:
        print(0)

### FIXED CODE ###

s=input()
n=len(s)
k=""
t=0
for i in range(n):
    if s[i]=="B" and t!=0:
        k=k[:-1]
        t=t-1
    if s[i]=="0":
        k=k+"0"
        t=t+1
    if s[i]=="1":
        k=k+"1"
        t=t+1
print(k)
# 2019/08/01

from fractions import gcd

n,m=map(int,input().split())

def divisors(n,m):
    div=[]
    end=min(m//n,int(pow(m,0.5)))
    for i in range(2,end+1):
        if m%i==0:
            div.append(i)
    return div

res=divisors(n,m)
print(res[-1])



### FIXED CODE ###

# 2019/08/01

n,m=map(int,input().split())

def divisors(n,m):
    div=[]
    end=int(pow(m,0.5))
    for i in range(1,end+1):
        if m%i==0:
            div.append(i)
            div.append(m//i)
    div.sort(reverse=True)
    return div

res=divisors(n,m)
for e in res:
    if m//n>=e:
        print(e)
        break
# -*- coding: utf-8 -*-

N = int(input().strip())

sp_list=[]
for i in range(N):
    s,p = input().rstrip().split()
    sp_list.append( [i+1,s,int(p)] )
#-----

sp_list.sort( key=lambda x:(x[1],-x[2]) )

for i,s,p in sp_list:
    print(i)


### FIXED CODE ###

# -*- coding: utf-8 -*-

A,P = list(map(int, input().rstrip().split()))
print( (A*3 + P)//2 )
s = list(map(int, input().split())
if s.count(5)==2 and s.count(7)==1:
	print("YES")
else:
    print("NO")

### FIXED CODE ###

s = list(map(int, input().split()))
if s.count(5)==2 and s.count(7)==1:
	print("YES")
else:
    print("NO")
import copy
import math
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = [1] * n
for _ in range(math.log(k)):
    for i in range(n):
        light = 0
        for j in range(n):
            if i < j:
                if (j - a[j] - 0.5) < i:
                    light += 1
            else:
                if (j + a[j] + 0.5) > i:
                    light += 1
        b[i] = light
    a = copy.deepcopy(b)
print(a)

### FIXED CODE ###

# ac
import sys
import numpy as np
from numba import njit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@njit('(i8[::1],)', cache=True)
def update(a):
    n = len(a)
    b = np.zeros_like(a)       # aと同じ形状の配列を生成(https://deepage.net/features/numpy-zeros.html)
    for i, x in enumerate(a):  # enumerateはindex, valueを返す
        l = max(0, i - x)      # lampの照らす範囲の下限（左側）
        r = min(n - 1, i + x)  # lampの上限（右側）
        b[l] += 1              # 以下imos法
        if r + 1 < n:          # r+1はx=nの時（最後のサイクル）r+1=nでindexの指定に失敗するから弾く（indexは0~n-1）
            b[r + 1] -= 1
    b = np.cumsum(b)           # bの要素の累積和（フィボナッチ数列みたいな）（imos法の締め）
    return b


n, k = map(int, readline().split())
a = np.array(read().split(), np.int64)

k = min(k, 41)                 # 今回の制限範囲のnなら41回も試行すればaの値が全て上限に達するのでそれ以上の試行は不要（解説PDF）
for _ in range(k):
    a = update(a)
print(' '.join(map(str, a)))   # joinメソッドはstrを''で区切って連結する
L,R = map(int,input().split())
count = 0
for x in range(L,R+1,1):
  for y in range(L,R+1,1):
    surplus = y % x
    xor_xy = bin(x ^ y)
    xor_10 = int(xor_xy,2)
    if (surplus == xor_10):
      count += 1
result = count % (10 ** 9 + 7)
print(result)

### FIXED CODE ###

a = int(input())
s = input()

if a >= 3200:
  print(s)
else:
  print("red")
A = list(map(int(), input().split()))
print(max(A)-min(A))

### FIXED CODE ###

A = list(map(int, input().split()))
print(max(A)-min(A))
def f(n, k):
  num_bit = 3 - bin(k).count('1')
  c = [0, 0, 1, 3]
  return 3**n - num_bit*2**n + c[num_bit]

# k = 0:(), 1:(3), 2(5), 3:(3, 5), 4:(7), 5:(3, 7), 6:(5, 7), 7:(3, 5, 7)
def solve(N, k=0):
  n = len(N)
  num_used = bin(k).count('1')
  if n==0 and num_used==3:
    return 1
  elif n==0 or n+num_used<3:
    return 0
  else:
    a = int(N[0])
    if a > 7:
      return f(n-1, k|1) + f(n-1, k|2) + f(n-1, k|4)
    elif a == 7:
      return f(n-1, k|2) + f(n-1, k|1) + solve(N[1:], k|4)
    elif a > 5:
      return f(n-1, k|2) + f(n-1, k|1)
    elif a == 5:
      return f(n-1, k|1) + solve(N[1:], k|2)
    elif a > 3:
      return f(n-1, k|1)
    elif a == 3:
      return solve(N[1:], k|1)
    elif a > 0:
      return 0

N = input()
base = sum([f(i, 0) for i in range(3, len(N))])
print(solve(N) + base)

### FIXED CODE ###

def f(n, k):
  num_bit = 3 - bin(k).count('1')
  c = [0, 0, 1, 3]
  return 3**n - num_bit*2**n + c[num_bit]

# k = 0:(), 1:(3), 2(5), 3:(3, 5), 4:(7), 5:(3, 7), 6:(5, 7), 7:(3, 5, 7)
def solve(N, k=0):
  n = len(N)
  num_used = bin(k).count('1')
  if n==0 and num_used==3:
    return 1
  elif n==0 or n+num_used<3:
    return 0
  else:
    a = int(N[0])
    if a > 7:
      return f(n-1, k|1) + f(n-1, k|2) + f(n-1, k|4)
    elif a == 7:
      return f(n-1, k|2) + f(n-1, k|1) + solve(N[1:], k|4)
    elif a > 5:
      return f(n-1, k|2) + f(n-1, k|1)
    elif a == 5:
      return f(n-1, k|1) + solve(N[1:], k|2)
    elif a > 3:
      return f(n-1, k|1)
    elif a == 3:
      return solve(N[1:], k|1)
    else:
      return 0

N = input()
base = sum([f(i, 0) for i in range(3, len(N))])
print(solve(N) + base)
s=int(input())
ans='Good'
for i in range(3):
  if s[i]==s[i+1]:
    ans='Bad'
print(ans)

### FIXED CODE ###

s=input()
ans='Good'
for i in range(3):
  if s[i]==s[i+1]:
    ans='Bad'
print(ans)
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

h,w=map(int,input().split())
for i in range(h+2):
    if i==0 or i==h+1:
        print("#"*w+"##")
    else:
        a=input()
        print("#"+a+"#")

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

x,y=map(int,input().split())
a=[4,6,9,11]
if x==2 or y==2 or (x in a and y not in a) or (x not in a and y in a):
    print("No")
else:
    print("Yes")
n,a,b=map(int, input().split())
t=''
while len(t)<n:
  t+='b'*a+'r'*b
t=t[::-1]
t=list(t)
g=0
for i in range(n):
  f=t.pop()
  if f=='b':
    g+=1
print(g)
  


### FIXED CODE ###

n,a,b=map(int, input().split())
t=a+b
s=n//t
p=n%t
g=0
if p<=a:
  g=p
else:
  g=a
print(s*a+g)
N,M=map(int,input().split())
numbers=[' ',]*N
kotae=0
for a in range(M):
    suuji=[]
    s,c=input().split()
    if numbers[int(s)-1]==' ':
        numbers[int(s)-1]=c
    else:
        if numbers[int(s)-1]==c:
            continue
        else:
            print('-1')
            kotae+=1
            break

for a in range(3):
    if numbers[a]==' ':
        numbers[a]=0
if numbers[0]==0:
    del numbers[0]
    if numbers[0]==0:
        del numbers[0]
        if numbers[0]==0:
            del numbers[0]
if kotae==0:
    if len(numbers)!=N:
        print('-1')
    else:
       moji=''
       for a in numbers:
           moji+=str(a)
       print(moji)


### FIXED CODE ###

N,M=map(int,input().split())
numbers=[' ',]*N
kotae=0
for a in range(M):
    suuji=[]
    s,c=input().split()
    if numbers[int(s)-1]==' ':
        numbers[int(s)-1]=int(c)
    else:
        if numbers[int(s)-1]==int(c):
            continue
        else:
            print('-1')
            kotae+=1
            break
if numbers[0]==' ' and N==3:
    numbers[0]=1
if N==2 and numbers[0]==' ':
    numbers[0]=1
for a in range(N):
    if numbers[a]==' ':
        numbers[a]=0
if N==3:
    if numbers[0] == 0:
        del numbers[0]
        if numbers[0] == 0:
            del numbers[0]
            if numbers[0] == 0:
                del numbers[0]
if N==2:
    if numbers[0] == 0:
        del numbers[0]
        if numbers[0] == 0:
            del numbers[0]
if kotae==0:
    if len(numbers)!=N:
        print('-1')
    else:
       moji=''
       for a in numbers:
           moji+=str(a)
       print(int(moji))
h,w=map(int,input().split())
print('#'*(w+2))
for i in range(h):
  print('#'+input()+'#')
print('#'+(w+2))

### FIXED CODE ###

h,w=map(int,input().split())
print('#'*(w+2))
for i in range(h):
    print('#'+input()+'#')
print('#'*(w+2))
N = int(input())
A = list(map(int, input().split()))

cnt = [0]*7
ziyu = 0
for a in A:
    if 1 <= a <= 399 and cnt[0] == 0:
        cnt[0] = 1
    elif 400 <= a <= 799 and cnt[1] == 0:
        cnt[1] = 1
    elif 800 <= a < 1199 and cnt[2] == 0:
        cnt[2] = 1
    elif 1200 <= a <= 1599 and cnt[3] == 0:
        cnt[3] = 1
    elif 1600 <= a <= 1999 and cnt[4] == 0:
        cnt[4] = 1
    elif 2000 <= a <= 2399 and cnt[5] == 0:
        cnt[5] = 1
    elif 2400 <= a <= 2799 and cnt[6] == 0:
        cnt[6] = 1
    elif 2800 <= a <= 3199 and cnt[7] == 0:
        cnt[7] = 1
    elif a <= 3200:
        ziyu += 1

min_cnt = 0
if ziyu > 0:
    min_cnt = 1

print(max(min_cnt, sum(cnt)), sum(cnt)+ziyu)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

cnt = [0]*8
ziyu = 0
for a in A:
    if 1 <= a <= 399 and cnt[0] == 0:
        cnt[0] = 1
    elif 400 <= a <= 799 and cnt[1] == 0:
        cnt[1] = 1
    elif 800 <= a < 1199 and cnt[2] == 0:
        cnt[2] = 1
    elif 1200 <= a <= 1599 and cnt[3] == 0:
        cnt[3] = 1
    elif 1600 <= a <= 1999 and cnt[4] == 0:
        cnt[4] = 1
    elif 2000 <= a <= 2399 and cnt[5] == 0:
        cnt[5] = 1
    elif 2400 <= a <= 2799 and cnt[6] == 0:
        cnt[6] = 1
    elif 2800 <= a <= 3199 and cnt[7] == 0:
        cnt[7] = 1
    elif a >= 3200:
        ziyu += 1

min_cnt = 0
if ziyu > 0:
    min_cnt = 1

print(max(min_cnt, sum(cnt)), sum(cnt)+ziyu)
#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const* argv[])
{
  int m;
  cin >> m;
  cout << 48 - m << endl;

  return 0;
}

### FIXED CODE ###

m = int(input())
print(48-m)