Harryxun/stf_run huggingface dataset:
n,m=map(int,input().split())
ac=[]
wt=[0 for _ in range(n)]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(p)
        pen += wt[p]
    else:
        if p in ac:
            pass
        else:
            wt[p] += 1
            
t_ac=set(ac)
print(len(t_ac),pen)

### FIXED CODE ###

n,m=map(int,input().split())
AC=[0 for _ in range(n)]
WA=[0 for _ in range(n)]
pen=0
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if s=="AC":
        if AC[p-1]==0:
            AC[p-1]=1
            pen += WA[p-1]
        else:
            pass
    else:
        if AC[p-1]==0:
            WA[p-1] +=1
        else:
            pass
print(AC.count(1),pen)
S = list(input())
for i in range (len(S)):
  if S[2i-2] == 'R' or S[2i-1]  == 'L':
    print('No')
  	quit()
print('Yes')

### FIXED CODE ###

S = input()
A = 'Yes'
for i in range(len(S)):
    if i%2==0 and S[i] == 'L':
        A = 'No'
    elif i%2 == 1 and S[i] == 'R':
        A = 'No'
print(A)
N = int(input())
ans = 0
for i in range(N):
	value, currency = input().split()
    if currency == 'JPY':
      ans += float(value)
    else:
      ans += float(value) * 380000.0
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(N):
  val, currency = input().split()
  if currency == 'JPY':
    ans += float(val)
  else:
    ans += float(val) * 380000.0
print(ans)
n,m =map(int,input().split())
A = list(map(int, input().split())) 

souwa = sum(A)
print(souwa)

hyou = 1(4*souwa)i
ninki = 0

for i in range(A):
    if A(i)>hyou:
      ninki = ninki + 1

if m == souwa:
     print('Yes')
else:
    print('No')

### FIXED CODE ###

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

souwa = sum(A)
hyou = souwa/(4*m)
ninki = 0

for number in A:
  if number >= hyou:
    ninki = ninki + 1

if m <= ninki:
    print('Yes')
else:
    print('No')
import sys

n = int(input())
d = list(map(int, input().split( )))

if d[0]!=0:
    print(0)
    sys.exit()

d.sort()

for i in range(n-1):
    if d[i]>d[i+1] or d[i]+1<d[i]:
        print(0)
        sys.exit()

m = max(d)

cnt = {i:0 for i in range(1,m+1)}

for i in range(1,n):
    cnt[d[i]] += 1

mod = 998244353
 
ans = 1

for i in range(2,m+1):
    ans *= pow(cnt[i-1],cnt[i],mod)
    ans %=mod 

print(ans)

### FIXED CODE ###

import sys

n = int(input())
d = list(map(int, input().split( )))

if d[0]!= 0:
    print(0)
    sys.exit()

d.sort()
if n >=2:
    if d[1] == 0:
        print(0)
        sys.exit()

for i in range(n-1):
    if d[i]>d[i+1] or d[i]+1<d[i]:
        print(0)
        sys.exit()

m = max(d)

cnt = {i:0 for i in range(1,m+1)}

for i in range(1,n):
    cnt[d[i]] += 1
mod = 998244353

ans = 1

for i in range(2,m+1):
    ans *= pow(cnt[i-1],cnt[i],mod)
    ans %=mod

print(ans)
a = int(input())

print((k//2)*((k+1)//2))

### FIXED CODE ###

a = int(input())
print((a//2)*((a+1)//2))
n = int(input())
res = 0
for i in range(len(n)):
  res = res + n[i]
  
print(res)

### FIXED CODE ###

n = int(input())
m = str(n)
res = 0
for i in range(len(m)):
  res = res + int(m[i])
if res == 1:
    res *= 10
print(res)
x, n= input().split()
x = int(x)
n = int(n)

array = [[0]]*100

for i in range(100):
    array[i] = 0
tmp = input().split(' ')
for i in range(n):
    array[int(tmp[i])] += 1

dif_tmp = 999
ret = 999
for i in range(100):
    if array[99-i] == 0:
        if abs(x-(99-i)) <= dif_tmp:
            ret = 99-i
            dif_tmp = abs(x-(99-i))
for i in range(1,100):
    if abs(x+i) <= dif_tmp:
        ret = -i
        dif_tmp = abs(x+i)
print(ret)

### FIXED CODE ###

x, n= input().split()
x = int(x)
n = int(n)

array = [[0]]*200
if n == 0:
    print(x)
else:
    for i in range(200):
        array[i] = 0
    tmp = input().split(' ')
    for i in range(n):
        array[int(tmp[i])] = 1
    
    dif_tmp = 999
    ret = 999
    for i in range(200):
        if array[199-i] == 0:
            if abs(x-(199-i)) <= dif_tmp:
                ret = 199-i
                dif_tmp = abs(x-(199-i))
    for i in range(1,100):
        if abs(x+i) <= dif_tmp:
            ret = -i
            dif_tmp = abs(x+i)
    print(ret)
N = int(input())
V = list(map(int, input().split()))

odd = {}
even = {}

for idx in range(N):
  if idx%2 == 0:
    if V[idx] in even:
      even[V[idx]] += 1
    else:
      even[V[idx]] = 1
  else:
    if V[idx] in odd:
      odd[V[idx]] += 1
    else:
      odd[V[idx]] = 1
sorted_odd = sorted(odd.items(), key=lambda x: -x[1])
sorted_even = sorted(even.items(), key=lambda x: -x[1])
fs_odd = sorted_odd[0][0]
fs_even = sorted_even[0][0]
if fs_odd == fs_even:
  if sorted_odd[1][1] > sorted_even[1][1]:
    fs_odd = sorted_odd[1][0]
    print(N-odd[fs_odd]-even[fs_even])
  else:
    fs_even = sorted_even[1][0]
    print(N-odd[fs_odd]-even[fs_even])
else:
  print(N-odd[fs_odd]-even[fs_even])



### FIXED CODE ###

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

odd = {}
even = {}

for idx in range(N):
  if idx%2 == 0:
    if V[idx] in even:
      even[V[idx]] += 1
    else:
      even[V[idx]] = 1
  else:
    if V[idx] in odd:
      odd[V[idx]] += 1
    else:
      odd[V[idx]] = 1
sorted_odd = sorted(odd.items(), key=lambda x: -x[1])
sorted_even = sorted(even.items(), key=lambda x: -x[1])
fs_odd = sorted_odd[0][0]
fs_even = sorted_even[0][0]
if fs_odd == fs_even:
  if sorted_odd[0][1] > sorted_even[0][1]:
    fs_even = sorted_even[1][0]
    print(N-odd[fs_odd]-even[fs_even])
  elif sorted_odd[0][1] < sorted_even[0][1]:
    fs_odd = sorted_odd[1][0]
    print(N-odd[fs_odd]-even[fs_even])
  else:
    if len(sorted_odd) == 1:
      print(N//2)
    else:
      if sorted_odd[1][1] > sorted_even[1][1]:
        fs_odd = sorted_odd[1][0]
        print(N-odd[fs_odd]-even[fs_even])
      else:
        fs_even = sorted_even[1][0]
        print(N-odd[fs_odd]-even[fs_even])
else:
  print(N-odd[fs_odd]-even[fs_even])
N = int(input())
A = list(map(int, input().split(" ")))
dp = dict()
mod = 10 ** 9 + 7

def f(i, r, b, g):
    if i == N:
        return 1
    if (i, r, b, g) in dp:
        return dp[(i, r, b, g)]
    ans = 0
    # iがr, b, gを被って矛盾がないかを見ていく
    if A[i] == r:
        ans += f(i + 1, r + 1, b, g)
    if A[i] == b:
        ans += f(i + 1, r, b + 1, g)
    if A[i] == g:
        ans += f(i + 1, r, b, g + 1)

    dp[(i, r, b, g)] = ans % mod
    return dp[(i, r, b, g)]

print(f(0, 0, 0, 0) % mod)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

N = int(input())
A = list(map(int, input().strip().split(" ")))
dp = {i: dict() for i in range(N)}
mod = 10 ** 9 + 7

def f(i, ma, mi):
    if i == N:
        return 1
    if (ma, mi) in dp[i]:
        return dp[i][(ma, mi)]
    if A[i] != ma and A[i] != mi and A[i] != i - ma - mi:
        dp[i][(ma, mi)] = 0
        return 0

    ans = 0
    # iがr, b, gを被って矛盾がないかを見ていく
    if A[i] == ma:
        ans += f(i + 1, ma + 1, mi)
    if A[i] == mi:
        if ma > mi + 1:
            ans += f(i + 1, ma, mi + 1)
        else:
            ans += f(i + 1, mi + 1, ma)
    if A[i] == i - ma - mi:
        ans += f(i + 1, ma, mi)

    dp[i][(ma, mi)] = ans % mod
    return ans % mod

print(f(0, 0, 0) % mod)
n,a,b = map(int, input().split())

if n == 0:
    print(0)
elif: a == 0:
    print(0)
elif b == 0:
    print(n)
elif a >= n:
    print(n)
elif a+b > n > a:
    print(a)
else:
    q,mod = divmod(n, a+b)
    print(q*a + mod)

### FIXED CODE ###

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

q, mod  =divmod(n, a+b)
print(q*a + min(mod,a))
S = input()
print(S[3] = '8')

### FIXED CODE ###

S = input()
print(S.replace('7', '8', 1))
s = list(str(input()))
a = int(s[0]+s[1])
b = int(s[2]+s[3])
if 0 < a < 13:
    if 0 < b < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")

else:
    if 0 < b < 13:
        print("YYMM")
    else:
        print("NA")
print(ans)


### FIXED CODE ###

s = list(str(input()))
a = int(s[0]+s[1])
b = int(s[2]+s[3])
if 0 < a < 13:
    if 0 < b < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")

else:
    if 0 < b < 13:
        print("YYMM")
    else:
        print("NA")
(a, b, c, d, e, f) = list(map(int, input().split()))
a *= 100
b *= 100

n = [[0, 0] for _ in range(f + 1)]
n[a][0] = a
for i in range(f + 1 - a):
    if n[i][0] != 0:
        n[i + a][0] = n[i][0] + a
n[b][0] = b
for i in range(f + 1 - b):
    if n[i][0] != 0:
        n[i + b][0] = n[i][0] + b
for i in range(f + 1 - c):
    if n[i][0] == 0:
        continue
    tmpt = n[i][0] / 100
    if (c + n[i][1]) / tmpt <= e :
        if n[i + c][1] == 0 and n[i + c][1] / (i + c) < (n[i][1] + c) / (i + c):
            n[i + c][0] = n[i][0]
            n[i + c][1] = n[i][1] + c
for i in range(f + 1 - d):
    if n[i][0] == 0:
        continue
    tmpt = n[i][0] / 100
    if (d + n[i][1]) / tmpt <= e:
        if n[i + d][1] == 0 and n[i + d][1] / (i + d) < (n[i][1] + d) / (i + d):
            n[i + d][0] = n[i][0]
            n[i + d][1] = n[i][1] + d
maxp = [0, 100, 0]
for i in range(len(n)):
    if(n[i][1] != 0 and maxp[0] < n[i][1] / i):
        maxp = [n[i][1] / i] + n[i]
print(str(maxp[1] + maxp[2]) + ' ' + str(maxp[2]))

### FIXED CODE ###

(a, b, c, d, e, f) = list(map(int, input().split()))
a *= 100
b *= 100

n = [[0, 0] for _ in range(f + 1)]
n[a][0] = a
for i in range(f + 1 - a):
    if n[i][0] != 0:
        n[i + a][0] = n[i][0] + a
if f >= b:
    n[b][0] = b
    for i in range(f + 1 - b):
        if n[i][0] != 0:
            n[i + b][0] = n[i][0] + b
for i in range(f + 1 - c):
    if n[i][0] == 0:
        continue
    tmpt = n[i][0] / 100
    if (c + n[i][1]) / tmpt <= e and n[i + c][1] / (i + c) < (n[i][1] + c) / (i + c):
            n[i + c][0] = n[i][0]
            n[i + c][1] = n[i][1] + c
for i in range(f + 1 - d):
    if n[i][0] == 0:
        continue
    tmpt = n[i][0] / 100
    if (d + n[i][1]) / tmpt <= e and n[i + d][1] / (i + d) < (n[i][1] + d) / (i + d):
            n[i + d][0] = n[i][0]
            n[i + d][1] = n[i][1] + d
maxp = [0, a, 0]
for i in range(len(n)):
    if(n[i][1] != 0 and maxp[0] < n[i][1] / i):
        maxp = [n[i][1] / i] + n[i]
print(str(maxp[1] + maxp[2]) + ' ' + str(maxp[2]))
H,W = map(int, input().split())
As = []
for i in range(H):
    As.append(list(map(int, input().split())))
diffs = []
for i in range(H):
    bs = list(map(int, input().split()))
    diffs.append([abs(a-b) for a,b in zip(As[i],bs)])

# 左右の対称性から、がんばったら80を超えることはなくないか？
M = 0
for i in range(H):
    for j in range(W):
        M = max(M, diffs[i][j])
M *= H + W    

# (i,j)において、偏りがkになることがあるか
diff_s = diffs[0][0]
# 初期値
dp = [[[False]*M for i in range(W)] for j in range(H)]
dp[0][0][diff_s] = True
# もらうDP
for i in range(H):
    for j in range(W):
        # 行方向
        if i+1 < H:
            d = diffs[i+1][j]
            for k in range(M):
                x = dp[i][j][k]
                if x:
                    if d + k < M:
                        dp[i+1][j][d+k] = x
                    dp[i+1][j][abs(d-k)] = x
        # 列方向
        if j+1 < W:
            d = diffs[i][j+1]
            for k in range(M):
                x = dp[i][j][k]
                if x:                
                    if d + k < M:                  
                        dp[i][j+1][d+k] = x
                    dp[i][j+1][abs(d-k)] = x
        # print(i,j,diffs[i][j],dp)

ans = 0
for i,b in enumerate(dp[i][j]):
    if b:
        print(i)
        exit()

### FIXED CODE ###

M = 6400*4
mid = M//2
INF = 10**18

H,W = map(int, input().split())
As = []
for i in range(H):
    As.append(list(map(int, input().split())))
diffs = []
for i in range(H):
    bs = list(map(int, input().split()))
    diffs.append([abs(a-b) for a,b in zip(As[i],bs)])

# bitset高速化
# 初期値
dp = [[0]*W for j in range(H)]
dp[0][0] = 1 << (mid+diffs[0][0]) #プラスマイナス考慮して、下駄をはかせる
for i in range(H):
    for j in range(W):
        # 行方向
        if i+1 < H:
            d = diffs[i+1][j]
            dp[i+1][j] |= dp[i][j] >> d  
            dp[i+1][j] |= dp[i][j] << d  
        # 列方向
        if j+1 < W:
            d = diffs[i][j+1]
            dp[i][j+1] |= dp[i][j] >> d
            dp[i][j+1] |= dp[i][j] << d

ans = INF
for i in range(M):
    if dp[H-1][W-1] >> i & 1:
        # print(i-mid)
        ans = min(ans, abs(i-mid))
print(ans)
a = input()
return a + a ** 2+ a ** 3

### FIXED CODE ###

a = int(input())
b = a + a ** 2 + a ** 3
print(b)
import heapq
from itertools import starmap
from operator import mul

R = lambda: map(int, input().split())
n, m = R()
a = [[x, 1] for x in R()]
heapq.heapify(a)
for _ in range(m):
    b, c = R()
    i = b
    while i and a[0][0] < c:
        x, y = a[0]
        if i < y:
            a[0][1] -= i
            i = 0
        else:
            heapq.heappop(a)
            i -= y
    if i < b:
        heapq.heappush(a, (c, b - i))
print(sum(starmap(mul, a)))


### FIXED CODE ###

import heapq
from itertools import repeat, starmap
from operator import mul

R = lambda: map(int, input().split())
n, m = R()
a = list(zip(R(), repeat(1)))
heapq.heapify(a)
for _ in range(m):
    b, c = R()
    i = b
    while i:
        x, y = a[0]
        if x >= c:
            break
        heapq.heappop(a)
        d = min(i, y)
        i -= d
        y -= d
        if y:
            heapq.heappush(a, (x, y))
    heapq.heappush(a, (c, b - i))
print(sum(starmap(mul, a)))
T = list(input())

s = T.count('?')

for i in range(s):
    a = T[T.index('?')]
    if a == 0:
        if T[T.index('?')+1] == 'D':
            T[T.index('?')] = 'P'
        else:
            T[T.index('?')] = 'D'
    elif a == len(T):
         T[T.index('?')] = 'D'
    else:
        if T[T.index('?')-1] == 'P':
            T[T.index('?')] = 'D'
        elif T[T.index('?')+1] == 'P':
            T[T.index('?')] = 'D'
        else:
            T[T.index('?')] = 'P'
print(''.join(T))

### FIXED CODE ###

T = input()

T = T.replace('?', 'D')
	
print(''.join(T))
A = []

N = int(input())

for i in range(0, N) :
    a = int(input())
    A.append(a)
    

print(max(A) - min(A))

### FIXED CODE ###

n = int(input())
A = input().split()
for i in range(len(A)) :
    A[i] = int(A[i])
print(max(A)-min(A))
from sys import
N,K=map(int,input().split())
A=list(map(int,input().split()))
ans=[]
def saiki(B):
    if len(B)==K+1:
        ans.append(B)
        print(B[-1])
        return
    B.append(A[B[-1]-1])
    saiki(B)
saiki([1])
#print(ans)

### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
kari=set()
hako=set()
count=1
cnt=1
zahyo=0
ans=0
kari.add(zahyo)
if K<=10**6:
    for i in range(K):
        ans=A[ans]-1
    print(ans+1)
    exit()
for i in range(N):
    zahyo=A[zahyo]-1
    if zahyo not in kari:
        kari.add(zahyo)
        count+=1
    else:
        break

hako.add(zahyo)
for i in range(N):
    zahyo=A[zahyo]-1
    if zahyo not in hako:
        hako.add(zahyo)
        cnt+=1
    else:
        break
count=len(kari)
cnt=len(hako)
kaisu=K-count
#print(zahyo)
if kaisu>N:
    kaisu=kaisu%cnt
for i in range(kaisu):
    zahyo=A[zahyo]-1
#print(zahyo,kaisu,count,cnt)
#print(kari,hako)
print(zahyo+1)
from math import gcd

A,B,C,D = map(int,input().split())

n_c = B//C - (A-1)//C
n_d = B//D - (A-1)//D
lcm_cd = C*D // gcd(C,D)
n_cd = B//lcm_cd - (A-1)//lcm_cd

print(B-A+1 - (n_c+n_d-n_cd))


### FIXED CODE ###

A,B,C,D = map(int,input().split())

def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

n_c = B//C - (A-1)//C
n_d = B//D - (A-1)//D
lcm_cd = C*D // gcd(C,D)
n_cd = B//lcm_cd - (A-1)//lcm_cd

print(B-A+1 - (n_c+n_d-n_cd))
s = input()
# s = "01B0"
# print(s[0])

ans = []
for key in range(len(s)):

    if s[key] == "0" or s[key] == "1":
        ans.append(s[key])
    if s[key] == "B":
        ans.pop(-1)
print("".join(ans))

### FIXED CODE ###

s = input()
# s = "01B0"
# print(s[0])

ans = []
for key in range(len(s)):

    if s[key] == "0" or s[key] == "1":
        ans.append(s[key])
    if s[key] == "B" and len(ans) > 0:
        ans.pop(-1)
print("".join(ans))
import math
a,b,x = map(int, input().split())
def f(a,b,t):
  if t < math.atan(a/b): return a*a*b - a*a*a*math.tan(t)/2
  elif t > math.atan(a/b): return a*b*b*math.tan(math.pi/2-t)/2
  else: return a*a*b/2
  
err = x-f(a,b,math.atan(a/b))
if abs(err) < 1e-6:
  print(math.degrees(math.atan(a/b)))
else:
  if err > 0:
    ths = [(math.atan(a/b) - 0)*i/3 for i in range(4)]
  else:
    ths = [(math.pi/2-math.atan(a/b))*i/3+math.atan(a/b) for i in range(4)]

  abs_err = map(abs,[x-f(a,b,th) for th in ths])
  eps = 1e-6
  while min(abs_err) > eps:
    err = [x-f(a,b,th) for th in ths]
    abs_err = list(map(abs,err))
    n_i = err.index(max([e for e in err if e<0]))
    p_i = n_i+1
    ths = [(ths[p_i]-ths[n_i])*i/3+ths[n_i] for i in range(4)]

  print(math.degrees(ths[abs_err.index(min(abs_err))]))

### FIXED CODE ###

from math import tan, pi
a,b,x = map(int, input().split())
eps = 1e-6

def f(a,b,t):
  if pi/2-t<eps: return 0
  if b*tan(pi/2.-t) < a: return b*b*tan(pi/2.-t)/2.*a
  else: return a*a*b - a*a*tan(t)/2.*a
  
th_p, th_n = pi/2, 0.
for i in range(100000):
  th_m = (th_p + th_n)/2.
  err = f(a,b,th_m) - x
  if err**2 < eps**2: break
  elif err < 0: th_p = th_m
  else: th_n = th_m
print(180/pi*th_m)
a, p = map(int(), input().split())

ans = (a * 3 + p) // 2

print("{}".format(ans))

### FIXED CODE ###

a, p = map(int, input().split())
print(int((3*a+p)/2))
n=int(input())
h=list(map(int,input().split()))
cnt=0
for i in range(n):
  if h[i+1]>h[i]+1:
    cnt=1
if cnt==0:
  print('Yes')
else:
  print('No')
    


### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
for i in range(1,n):
  if h[-i]+1==h[-i-1]:
    h[-i-1]-=1
  elif h[-i]+1<h[-i-1]:
    print('No')
    exit()
print('Yes')
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a = sorted(a)

    max_a = a[-1]
    dp = [True] * max_a

    for i in a:
        x = 1
        while i * x <= max_a:
            dp[i * x] = False
            x += 1

    ans = 0
    for i in a:
        if dp[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n = int(input())
    a = list(map(int, input().split()))
    a = sorted(a)

    max_a = max(a) + 1
    dp = [True] * max_a

    for idx in range(len(a)):
        if idx + 1 != len(a) and a[idx] == a[idx + 1]:
            dp[a[idx]] = False
        i = a[idx]
        x = 2
        while i * x < max_a:
            dp[i * x] = False
            x += 1

    ans = 0
    for i in a:
        if dp[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()
N = int(input())
X = [int(_) for _ in input().split()]
ans_list = []
for i in range(min(X), max(X)):
    ans = 0
    for j in X:
        ans += (j - i) ** 2
    ans_list.append(ans)

print(min(ans_list))


### FIXED CODE ###

import sys
N = int(input())
X = [int(_) for _ in input().split()]
ans_list = []
if N == 1:
    print('0')
    sys.exit()
for i in range(min(X), max(X) + 1):
    ans = 0
    for j in X:
        ans += (j - i) ** 2
    ans_list.append(ans)

print(min(ans_list))
from collections import defaultdict

N = int(input())
d = {1:"a", 2:"b", 3:"c", 4:"d", 5:"e", 6:"f", 7:"g", 8:"h", \
     9:"i", 10:"j", 11:"k", 12:"l", 13:"m", 14:"n", 15:"o", 16:"p", 17:"q", \
      18:"r", 19:"s", 20:"t", 21:"u", 22:"v", 23:"w", 24:"x", 25:"y", 26:"z"}

def Base_10_to_n(X, n):
    if(int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)+","
    return str(X%n)+","

a = Base_10_to_n(N, 26)
a = list(a.split(","))
ans = ""

for i in a:
    if(i == ""):
        continue
    ans += d[int(i)]        
print(ans)

### FIXED CODE ###

from collections import defaultdict

d = {1:"a", 2:"b", 3:"c", 4:"d", 5:"e", 6:"f", 7:"g", 8:"h", \
     9:"i", 10:"j", 11:"k", 12:"l", 13:"m", 14:"n", 15:"o", 16:"p", 17:"q", \
      18:"r", 19:"s", 20:"t", 21:"u", 22:"v", 23:"w", 24:"x", 25:"y", 0:"z"}

N = int(input())
n = N
ans = ""

while n > 0:
    x = n%26
    ans += d[x]
    if(x == 0):
        n = n//26-1
    else:
        n //= 26

print(ans[::-1])
def tax(p,x):
    return p*(100+x) // 100 # 整数除算

def solve(X,Y,S):
    ans = 0
    oldsum = 0
    for a in range(1,S):
        for b in range(1,S-a+1): #税抜き価格a,bの総和はS以下である
            oldsum = tax(a,X)+tax(b,X) #税制改定前の税込合計額
            if oldsum == S: # 新税でのtax(a,Y)+tax(b,Y) について検討 
                newsum = tax(a,Y)+tax(b,Y) 
                if newsum > ans:
                    ans =newsum
            if oldsum > S:
                break # b増加ならばsum増加のため
    return(ans)

while True:
    X,Y,S = map(int, input().split())
    if a == 0:
        break
    print(solve(a,b,c))


### FIXED CODE ###

def tax(p,x):
    return p*(100+x) // 100 # 整数除算

def solve(X,Y,S):
    ans = 0
    oldsum = 0
    newsum = 0
    for a in range(1,S):
        for b in range(1,S-a+1): #税抜き価格a,bの総和はS以下である
            oldsum = tax(a,X)+tax(b,X) #税制改定前の税込合計額
            if oldsum == S: # 新税でのtax(a,Y)+tax(b,Y) について検討 
                newsum = tax(a,Y)+tax(b,Y) 
                if newsum > ans:
                    ans =newsum
            if oldsum > S:
                break # b増加ならばsum増加のため
    return ans

while True:
    X,Y,S = map(int, input().split())
    if X == 0:
        break
    print(solve(X,Y,S))
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest 125
# C - GCD on Blackboard

# N-1個の全パターンの最大公約数の最大値でOK

# 最大公約数を計算
# ユークリッドの互除法を用いる
# def gcd(x, y):
#     # 大きい方をaに
#     a, b = (x,y) if x>y else (y,x)
#     if a == b:
#         return a
#     else:
#         return gcd(a-b,b)

# 再帰で書くと数字が大きいときに最大深さを超えてしまう！
def gcd(x, y):
    while x != y:
        x, y = (x-y,y) if x>y else (y-x,x)
    return x
        

# N個の整数に対する最大公約数の計算
def calc(n, an):
    if n == 2:
        return gcd(an[0], an[1])
    else:
        return gcd(an[0], calc(n-1, an[1:]))


n = int(input())
an = [int(x) for x in input().split(' ')]

if n == 2:
    print(max(an))
else:
    #N-1個の組み合わせに対する最大公約数で最大のものを選ぶ
    # N-1個の組み合わせ
    bn = [[an[j] for j in range(n) if i != j] for i in range(n)]
    gcds = [calc(n-1, ary) for ary in bn]
    print(max(gcds))

### FIXED CODE ###

hoge = input()

a, b, t = [int(x) for x in hoge.split(' ')]

print(int(((t+0.5)//a)*b))
ans = 0
H,W = map(int,input().split())
s = [list(input()) for _ in range(W)]
if s[H-1][W-1] == '#':
  ans += 1
if s[0][0] == '#':
  ans += 1
for i in range(H):
  for j in range(W):
    if s[i][j] == '.':
      s[i][j] = 0
    else:
      s[i][j] = 1
      
i = 0
j = 0

while i < H-1 and j < W-1:
  if s[i+1][j] != 1:
    i += 1
  elif s[i][j+1] != 1:
    j += 1
  elif s[i+1][j] == 1 and s[i][j+1] == 1:
    if i < W-2:
      i += 1
    else:
      j += 1
    ans += 1
print(ans)

### FIXED CODE ###

H,W = map(int,input().split())
s = [list(input()) for _ in range(H)]
dp = [[0] * W for _ in range(H)]
dp[0][0] = int(s[0][0]=="#")

for i in range(1, W):
    dp[0][i] = dp[0][i-1] + (int(s[0][i]=="#") if s[0][i-1]=="." else 0)
for h in range(1,H):
  dp[h][0] = dp[h-1][0] + (int(s[h][0]=="#") if s[h-1][0]=="." else 0)
  for w in range(1,W):
    dp[h][w] = min(dp[h-1][w]+(int(s[h][w]=="#") if s[h-1][w]=="." else 0), 
    dp[h][w-1]+(int(s[h][w]=="#") if s[h][w-1]=="." else 0))
print(dp[-1][-1])
# https://img.atcoder.jp/abc123/editorial.pdf
# 問題D: Cake 123 解法 #3 - さらに高速な解法、priority-queue を用いて O(K log K)

from heapq import heappush, nlargest

def solve(X, Y, Z, K, A, B, C):
    A.sort(reverse=True)
    B.sort(reverse=True)
    C.sort(reverse=True)

    Q = []
    for a in A:
        for b in B:
            heappush(Q, a+ b)
    AB = nlargest(K, Q)

    Q2 = []
    for ab in AB:
        for c in C:
            heappush(Q2, ab + c)
    ABC = nlargest(K, Q2)
    print("\n".join(map(str, ABC)))

if __name__ == "__main__":
    X, Y, Z, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    solve(X, Y, Z, K, A, B, C)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
dists = [a, b, c, d, e]
if max(dists) - min(dists) > k:
    print(":(")
else:
    print("Yay!")
a, b = map(int, input().split())
print(max(0,a-(b*2))

### FIXED CODE ###

a, b = map(int, input().split())
print(max(0,a-(b*2)))