peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N=int(input())
Students=list(map(int,input().split()))


d={}

for i in range(N):
    d[i+1]=Students[i]

d_2 = sorted(d.items(),key=lambda x: x[1])

ans=[]
for k in d_2:
    ans.append(k[0])

print(*ans)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3, p = 0, 0, 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m > x:
        break
      elif m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
    if m > x:
      break
  i2 = 0
  i1 += 1
  if m > x:
    break
print(p)
# Judge status: Accepted
import sys
input = sys.stdin.readline
s=input().strip()
a=[]
for i in range(3):
    a.append(s[i])
a.sort()
if a[0]=="a" and a[1]=="b" and a[2]=="c":
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s = input()
print('A' + s[0] + 'C')
# Judge status: Accepted
d = int(input())
print('Christmas '+'Eve '*(25-d))
# Judge status: Accepted
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
counter_a = Counter(a)
ok_list = []
for key,value in counter_a.items():
    if value >= 4:
        ok_list.append(key)
        ok_list.append(key)
    elif value >= 2:
        ok_list.append(key)
    else:
        continue
ok_list.sort(reverse=True)
if len(ok_list) >= 2:
    ans = ok_list[0] * ok_list[1]
else:
    ans = 0
print(ans)
# Judge status: Wrong Answer
#--Security

code = list(input())

if(code[0] == code[1]):
  print("Bad")
elif(code[1] == code[2]):
  print("Bad")
elif(code[2] == code[3]):
  print("Bad")
else:
  print("Yes")
# Judge status: Accepted
N=int(input())
ans=""

for _ in range(10**5):
	N-=1
	ans+=chr(ord("a")+(N%26))
	N=N//26
	if N<=0:
		break

print(ans[::-1])
# Judge status: Accepted
a,b=map(int,input().split())
print(a*b if (a<10 and b<10) else -1)
# Judge status: Wrong Answer
x, y = map(int,input().split())
num = y/x
ans = 1
while True:
  num /= 2
  if  num >= 1:
    ans += 1
  else:
    break
print(ans)
# Judge status: Accepted
n, a, b = map(int, input().split())
ans = [max(a-1, b-1), max(n-a, n-b)]
dis = abs(a-b)
if dis % 2 == 0:
    ans.append(dis//2)
else:
    if abs(a-b) > 2:
        cto = min(a, b)
        ans.append((dis-1)//2+cto)
        ctn = min(n-a, n-b)
        ans.append((dis-1)//2+ctn+1)
print(min(ans))
# Judge status: Accepted
import math
N,X,T=map(int,input().split())
print(math.ceil(N/X)*T)
# Judge status: Wrong Answer
import sys

# N: コマ数
# M: 地点数

N,M,*X = map(int, open(0).read().split())

# コマ数が地点数以上の場合、各地点にコマを配置できる
# よって 0 回の移動で目的を達成できる
if N >= M:
    print(0)
    sys.exit()

X.sort()
D = sorted(abs(X[i+1] - X[i]) for i in range(M-1))
print(X[-1] - X[0] - sum(D[-(N-1):]))
# Judge status: Accepted
h, n = map( int, input().split() )
a = list( map( int, input().split() ) )

if sum( a ) < h:
    print( "No" )
else:
    print( "Yes" )
# Judge status: Accepted
a = int(input())
x = []
for i in range(a):
    x.append(input())
print("AC x " + str(x.count("AC")))
print("WA x " + str(x.count("WA")))
print("TLE x " + str(x.count("TLE")))
print("RE x " + str(x.count("RE")))
# Judge status: Wrong Answer
import math



a=input()
b=input()


print("YES" if a[0]==b[2] and b[0] ==a[2] else "NO")
# Judge status: Accepted
L = [2, 1]
for _ in range(2, 86 + 1):
  L.append(L[-1] + L[-2])

print(L[int(input())])
# Judge status: Accepted
n,k,*a=map(int,open(0).read().split())
l,r=0,10**9
while~l+r:
 x=l+r>>1
 if-sum(-b//x+1for b in a)>k:l=x
 else:r=x
print(r)
# Judge status: Accepted
n,q = map(int,input().split())
s =str(input())
l = [0]*n
r = [0]*n
for i in range(1,n):
    if s[i] == 'C':
        if s[i - 1] == 'A':
            l[i] = 1
            r[i] = 1
for i in  range(1, n):
    l[i] = l[i] + l[i - 1]
    r[i] = r[i] + r[i - 1]
for i in range(q):
    a,b = map(int,input().split())
    print(r[b - 1] - l[a -1])
# Judge status: Accepted
S = input()

for i in range(len(S)-1):
  if S[i] == S[i+1]:
    print("Bad")
    exit()
print("Good")
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a%b!=0:
    if a%2==0 and b%2 == 0 and c%2==0:
        print("Yes")
    elif a%2==0 and b%2==1 and c%2==1:
        print("Yes")
    elif a%2==1 and b%2==0 and c%2==1:
        print("Yes")
    elif a%2==1 and b%2==1 and c%2==0:
        print("Yes")
    else:
        print("No")
else:
    print("No")
# Judge status: Wrong Answer
n, xx = map(int, input().split())
x = list(map(int, input().split()))

x.append(xx)
x.sort()

dis = 10 ** 9
for i in range(n):
    dis = min(dis, x[i + 1] - x[i])

print(dis)
# Judge status: Accepted
N = int(input())
C = input()

l = 0
while l < N and C[l] == "R":
    l += 1
r = N-1
while r > 0 and C[r] == "W":
    r -= 1

ans = 0
while l < r:
    if C[l] == "W" and C[r] == "R":
        ans += 1
        l += 1
        r -= 1
    elif C[l] == "W":
        r -= 1
    elif C[r] == "R":
        l += 1
    else:
        l += 1
        r -= 1

print(ans)
# Judge status: Accepted
def main():
    S = list(input())
    T = list(input())
    ans = float('inf')
    for i in range(len(S)):
        cnt = 0
        flag = True
        for j in range(len(T)):
            if i + j >= len(S):
                flag = False
                break
            if S[i+j] != T[j]:
                cnt += 1
        if flag:
            ans = min(ans, cnt)

    print(ans)




if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]
SA = list(reversed(sorted(A)))
for a in A:
    if a == SA[0]:
        print(SA[1])
    else:
        print(SA[0])
# Judge status: Wrong Answer
n = int(input())
a = sorted([int(i) for i in input().split()])
ans = 'Yes'
for i in range(1, n):
  if a[i-1] == a[i]:
    ans = 'No'
    break
print(ans)
# Judge status: Accepted
import math
n = int(input())
x = list(map(int, input().split()))
y = round((2*sum(x))/(2*n))
ans = 0
for i in range(n):
  ans += (y-x[i])**2
print(ans)
# Judge status: Wrong Answer
n= int(input())
a,b,c = 2,1,3
for i in range(n-1):
  a,b,c=b,c,b+c
print(a)
# Judge status: Accepted
N = int(input())
L = [0] * (404040)
A = map(int, input().split())
ans = 0
for i, a in enumerate(A):
    ia = i - a
    if ia >= 0:
        ans += L[ia]
    ai = a + i
    if ai < 404040:
        L[ai] += 1
print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
s=ans=sum(A)
k=0
for i in range(N-1):
    k+=A[i]
    ans=min(ans,abs(s-2*k))
print(ans)
# Judge status: Wrong Answer
s = input()
s1 = s[:int((len(s)-1) / 2)]
s1r = s1[::-1]
s2 = s[int((len(s)+1) / 2):]
s2r = s2[::-1]
if s1 == s1r and s2 == s2r:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
words = []
for i in range(n):
  words.append(input())

if len(words) != len(set(words)):
  print("No")
else:
  for i in range(n-1):
    if words[i][-1] != words[i+1][0]:
      print("No")
      break
  print("Yes")
# Judge status: Accepted
#132_A
s=input()
print('Yes' if len(set(s))==2 and all(s.count(s[i]) for i in range(4)) else 'No')
# Judge status: Accepted
N, A, B = map(int, input().split())

if B < A:
  print(0)
elif N == 1 and A!= B:
  print(0)
elif N == 1 and A == B:
  print(1)
else:
  print(1 + ( N - 2) * (B - A))
# Judge status: Wrong Answer
s = input()

s0 = 0
s1 = 1

for c in s:
    if c == '0':
        s0 += 1
    else:
        s1 += 1

print(min(s0, s1)*2)
# Judge status: Accepted
from  functools import reduce
from fractions import gcd
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=[i//2 for i in a]
#print(a)
lc=reduce(lambda x,y: (x*y)//gcd(x,y) , a)
#print(lc)
flag=True
for i in a:
  if (lc//i)%2==0:
    flag=False
    break
if flag==False:
  print(0)
else:
  x=m//lc
  print(x//2) if (x%2)==0 else print((x//2)+1)
# Judge status: Accepted
# coding: utf-8

n = int(input().rstrip())

scorelist = list(map(int, input().rstrip().split(" ")))

color1 = len(set([int(i/400) for i in scorelist if i < 3200]))

color2 = len([i for i in scorelist if i >= 3200])

ans_min = max(1, color1)
ans_max = color1 + color2

print("{} {}".format(ans_min, ans_max))
# Judge status: Accepted
from collections import Counter

n=int(input())
l=[input() for i in range(n)]
c=Counter(l)
d=max(c.values())
max_list=[k for k,v in c.items() if v==d]
max_list.sort()
for j in max_list:
  print(j)
# Judge status: Wrong Answer
#!/usr/bin/env python3
n = int(input())
x = list(map(int,input().split()))
a = sorted(x)
base = a[n//2]
for i in range(n):
    if x[i] > a[n//2-1] or (x[i] == a[n//2-1] and a.count(x[i]) > 1): print(a[n//2-1])
    else: print(a[n//2])
# Judge status: Wrong Answer
import itertools
n,m,x=map(int,input().split())
l=[tuple(map(int,input().split())) for _ in range(n)]
total=m*(10**5)
for i in range(1, n+1):
    for j in itertools.combinations(range(n), i):
        num=0
        a=[0]*m
        for k in j:
            num+=l[k][0]
            for m_ in range(m):
                a[m_] += l[k][m_+1]
        if len(list(filter(lambda x_: x <= x_, a))) == m:
            total = min(num, total)
print(total)
# Judge status: Wrong Answer
def pow_r(x, n):
    """
    O(log n)
    """
    if n == 0:  # exit case
        return 1
    if n % 2 == 0:  # standard case ① n is even
        return pow_r(x ** 2, n // 2)
    else:  # standard case ② n is odd
        return x * pow_r(x ** 2, (n - 1) // 2)
total = 0
num = int(input())
for i in range(1, num):
    total += pow_r(2, i)

print(total)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
abig = 0
bbig = 0
for i in range(n):
    if a[i] > b[i]:
        abig += 1
    elif a[i] < b[i]:
        bbig += 1
if abig % 2 == bbig % 2:
    print("Yes")
else:
    print("No")
print(abig, bbig)
# Judge status: Accepted
d = {"SUN":7, "MON":6, "TUE":5, "WED":4, "THU":3, "FRI":2, "SAT":1}
print(d[input()])
# Judge status: Accepted
h = int(input())
cnt = 0
i = 1
while h > 1:
    cnt += i
    h = h//2
    i *= 2
cnt += i
print(cnt)
# Judge status: Accepted
def solve():
    a, b, c, k = map(int, input().split())
    if k > a + b:
        ans = a - (k - a - b)
        print(ans)
    else:
        print(min(k, a))


if __name__ == '__main__':
    solve()
# Judge status: Accepted
N,M,X=map(int,input().split())
A=[input().split() for _ in range(N)]
ans=[]

for i in range(2**N):
    score=[0]*M
    price=0
    for j in range(N):
        if ((i>>j) & 1):
            price+=int(A[j][0])
            for k in range(M):
                score[k]+=int(A[j][k+1])
    if sorted(score)[0] >= X:
        ans.append(price)

print(-1 if len(ans)==0 else min(ans))
# Judge status: Wrong Answer
M = 1000000007

N, K = map(int, input().split())
A = list(map(int, input().split()))
prefix = [1] * (N + 1)
for i, a in enumerate(A, 1):
    prefix[i] = prefix[i - 1] * a
    prefix[i] %= M

prev = prefix[K]
for i in range(K + 1, N + 1):
    cur = prefix[i] * pow(prefix[i - K], -1, M)
    cur %= M
    if cur > prev:
        print('Yes')
    else:
        print('No')
    prev = cur
# Judge status: Accepted
N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)

d = {}
l = []
for a in A:
  if a in d:
    d[a] += 1
    if d[a] % 2 == 0:
      l.append(a)
  else:
    d[a] = 1
  
  if len(l) == 2:
    print(l[0] * l[1])
    quit()

print(0)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
count=0
for i in range(n):
    if a[i]!=i+1-count:
        count=count+1
if count==0:
    count=-1
print(count)
# Judge status: Wrong Answer
import math
 


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

if math.sqrt(a)+math.sqrt(b)<math.sqrt(c):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
s=list(input())
c=[0 for _ in range(n)]
c[0]=s[1:].count('W')
for i in range(1,n):
	if s[i-1] =='W' and s[i]=='W':
		c[i]=c[i-1]-1
	elif s[i-1]=='E' and s[i]=='E':
		c[i]=c[i-1]+1
	else:
		c[i]=c[i-1]
print(n-1-max(c))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
    A[i] -= (i+1)
    
A.sort()

idx = N//2
ans = 0
for i in range(N):
    ans += abs(A[i]-A[idx])
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))

Alice = 0
Bob = 0
A.sort(reverse=True)

if N%2 == 0:
    for i in range(int(N/2)):
        Alice += A[2*i]
        Bob += A[2*i+1]
        print(Alice-Bob)
        
else:
    for i in range(int((N-1)/2)):
        Alice += A[2*i]
        Bob += A[2*i+1]
    Alice += A[-1]
    print(Alice-Bob)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
def inputS(): return input().rstrip().decode()
readlines = sys.stdin.buffer.readlines  

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

if K <= A:
  A -= K
  print(A, B)
elif K <= (A+B):  
  B -= (K-A)
  print(0, B)
else: # (A+B) < K
  print(0, 0)
# Judge status: Wrong Answer
N = int(input())
S = input().strip()
C = {"(":0,")":0}
for i in range(N):
    C[S[i]] += 1
x = C["("]-C[")"]
if x>=0:
    S = S+")"*x
else:
    S = "("*(-x)+S
print(S)
# Judge status: Accepted
S = input()

odd = ["R", "U", "D"]
even = ["L", "U", "D"]

flag = True
for i in range(len(S)):
    if (i + 1) % 2 == 0:
        if S[i] not in even:
            print("No")
            flag = False
            break
    else:
        if S[i] not in odd:
            print("No")
            flag = False
            break

if flag:
    print("Yes")
# Judge status: Wrong Answer
n = int(input())
x = 0
y = 0
t = 0
c = []

for i in range(n):
    c.append(list(map(int,input().split())))

for i in range(n):
    t = c[i][0] - t
    a = c[i][1]
    b = c[i][2]

    if (t - abs((x+y) - (a+b))) %2 == 0 and abs((x+y) - (a+b)) <= t:
        x = a
        y = b
    else:
        print("No")
        exit()

print("Yes")
# Judge status: Accepted
a,b,c = map(int,input().split())
cnt = 0
for i in range(b):
    cnt += a
    if cnt % b == c:
        print("YES")
        exit()
print("NO")
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0

for i in range(n):
    tmp = A[i] - B[i]
    if tmp < 0 and -tmp <= A[i+1]:
        A[i+1] += tmp
        ans += B[i]
    elif tmp < 0 and -tmp > A[i+1]:
        ans += A[i] +A[i+1]
        A[i+1] = 0
    elif tmp >= 0:
        ans += B[i]

print(ans)
# Judge status: Accepted
def count(Xi):
    ans = 0
    for p in range(N):
        ans += (X[p]-Xi)**2
    return ans
    

N = int(input())
X = [int(x) for x in input().split()]
l =[]


for i in range(101):
    l.append(count(i))

print(min(l))
# Judge status: Accepted
n, m = map(int, input().split())
if n == 1 and m == 1:
    result = 1
elif n == 1:
    result = m - 2
elif m == 1:
    result = n - 2
elif n == 2 or m == 2:
    result = 0
else:
    result = (n-2)*(m-2)
print(result)
# Judge status: Accepted
S = input()

now = ''
prev = ''
ans = 0
for s in S:
    now += s
    if now!=prev:
        ans += 1
        prev = now
        now = ''
print(ans)
# Judge status: Wrong Answer
N = int(input())
lst = [int(x) for x in input().split()]
dp = [10 ** 5 for _ in range(N)]
dp[0] = 0
dp[1] = abs(lst[1] - lst[0])
for i in range(N - 1):
    dp[i + 1] = min(dp[i + 1], dp[i] + abs(lst[i + 1] - lst[i]))
    if i < N - 2:
        dp[i + 2] = min(dp[i + 2], dp[i] + abs(lst[i + 2] - lst[i]))
print(dp[N - 1])
# Judge status: Accepted
W, a, b = map(int,input().split())
 
if (a+W)<=b:
  print(b-(a+W))
elif (a<= b)and (b<(a+W)):
  print(0)
elif ((a-W)<=b) and(b<a):
  print(0)
elif b<(a-W):
  print(a-(b+W))
# Judge status: Wrong Answer
a,b=map(int,input().split())
print(min([a,b,12]))
# Judge status: Accepted
N = int(input())

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

ans = 0
for i,b in enumerate(B):
    t = min(b,A[i]+A[i+1])
    ans += t
    #A[i]を使いきったか否か
    A[i+1] -= max(0, t-A[i])
    
print(ans)
# Judge status: Accepted
import collections

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

# ap+aq == p-q (p>q)
# p-ap = q+aq

mp = {}
ans = 0
for p in range(N):
    if p-A[p]+1 in mp:
        ans += mp[p-A[p]+1]
    if p+A[p]+1 in mp:
        mp[p+A[p]+1] += 1
    else:
        mp[p + A[p] + 1] = 1

print(ans)
# Judge status: Wrong Answer
def coffee(string):
      if len(string) == 6 and string.islower():
            for i in range(0,len(string)):
                  if string[i+2] == string[i+3] and string[i+4] == string[i+5]:
                        return 'Yes'
                  else:
                        return 'No'
      else:
            return 'False'
                    
print(coffee('COFFEE'))
# Judge status: Wrong Answer
n=int(input())
p=list( map(int, input().split()))
ans=0
for i in range(n):
    if p[i]!=i+1:
        ans=ans+1
if ans<=2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted

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

la = []
for i in range(n):
    la.append(input())

lb = []
for i  in range(m):
    lb.append(input())

for i in range(n-m+1):
    for j in range(n-m+1):

        f = True
        for k in range(m):
            for l in range(m):
                if la[i+k][j+l] !=lb[k][l]:
                    f = False
        if f:
            print("Yes")
            exit()

print("No")
# Judge status: Wrong Answer
n = input()
s = list(map(int, input().split()))
if all(s):
    print(0)
else:
    print(max(s[(s.index(max(s))+1):]))
# Judge status: Accepted
A, B, N = [int(n) for n in input().split()]

c = min([B - 1, N])
y = (A * c - ((A * c) % B)) // B

print(y)
# Judge status: Wrong Answer
# https://atcoder.jp/contests/abc102/tasks/arc100_a
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


N = read_a_int()
A = read_ints()
B = [a - i for a, i in zip(A, range(1, N + 1))]

mu = sum(B) // N
ans = 0
ans1 = 0
for b in B:
    ans += abs(b - mu)
    ans1 += abs(b - mu - 1)

print(min(ans, ans1))
# Judge status: Wrong Answer
S = list(input())
for i in range(0,len(S),2):
  if S[i] == 'L':
    print('No')
    exit()
for j in range(1,len(S),2):
  if S[j] == 'R':
    print('No')
    exit()
print('Yes')
# Judge status: Accepted
s = input()
if s[0]==s[1]==s[2] or s[3]==s[1]==s[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S = int(input())
m = 10**9
x = (m - S % m) % m
y = (S + x) // m
print(0, 0, m, 1, x, y)
# Judge status: Accepted
h, n = map(int, input().split())
k = list(map(int, input().split()))
 
k = sorted(k,reverse=True)

k = k[n:]
 
print(sum(k))
# Judge status: Wrong Answer
inp = input()
inp = int(float(inp))
aaa =0
bbb =0
nega = 0
big = 0

if 0 <= inp and inp <= 10**9:
    if 500 <= inp:
        big = (inp // 500)
        sma = big % 500
        if 5 <= sma:
          nega = (sma // 5)
      
        aaa = 1000*big
        bbb = 5*nega
        print(aaa + bbb)
    elif 5 <= inp:
        nega = (inp // 5)
        bbb = 5*nega
        print(bbb)
else:
    print(0)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import collections


def main():
    n = int(input())
    s = [input() for i in range(n)]

    most_counters = collections.Counter(s).most_common()
    most_count = most_counters[0][1]

    for t in sorted(map(lambda x: x[0], filter(lambda x: x[1] == most_count, most_counters))):
        print(t)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N = int(input())
S = list(input())

rc = S.count("R")
gc = S.count("G")
bc = S.count("B")

tc = int(rc*gc*bc)

aa = 0
for i in range(N):
  for j in range(1,N//2):
    
    if i+j+j < N:
      if S[i] != S[i+j]:
        if S[i] != S[i+j+j]:
          if S[i+j] != S[i+j+j]:
            aa += 1
            
print(int(tc-aa))
# Judge status: Wrong Answer
import math
import sys

x,k,d=map(int,input().split())

num=math.floor(x/d)

if num>k:
  print(x-k*d)
  sys.exit()

n=x-num*d
remaining=k-num

if remaining%2==0:
  if n>0:
    print(n)
    
  else:
    print(n*-1)
    
else:
  if n>0:
    n-=d
    if n>0:
      print(n)
      
    else:
      print(n*-1)
      
  else:
    n+=d
    if n>0:
      print(n)
      
    else:
      print(n*-1)
# Judge status: Accepted
N,K,S = map(int,input().split())
A = [str(10**9) for i in range(N)]
if S != 10**9:
    for i in range(K):
        A[i] = str(S)
else:
    for i in range(N-K):
        A[i] = str(1)
A = ' '.join(A)
print(A)
# Judge status: Wrong Answer
def main():
    s = int(input())
    f = s/100
    b = s%100

    if f > 0 and f <= 12:
        if b > 0 and b <= 12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if b > 0 and b <= 12:
            print("YYMM")
        else:
            print("NA")

main()
# Judge status: Wrong Answer
import sys

import numpy as np

n, m, x = map(int, input().split())
c = []
for _ in range(n):
    c.append(np.array(list(map(int, input().split()))))


def ok(lst):
    for tokuten in lst:
        if tokuten < 10:
            return False
    return True


c.sort(key=lambda e: e[0])

total = np.array([0] * (m + 1))

for book in c:
    total += book
    if ok(total[1:]):
        print(total[0])
        sys.exit()
print(-1)
# Judge status: Accepted
s = input()
l = len(s)

INF = float('inf')
dp = [[INF]*2 for _ in range(l+1)]
dp[0][0]=0
dp[0][1]=1
for i in range(l):
    num = int(s[i])
    dp0 = dp[i][0]
    dp1 = dp[i][1]
    dp[i+1][0] = min(dp0+num, dp1+min(10-num,num+1))
    dp[i+1][1] = min(dp0+num+1,dp1+10-num-1)

print(dp[-1][0])
# Judge status: Wrong Answer
n = int(input())
a = []
for _ in range(2):
    a.append(list(map(int, input().split(" "))))

res = 0
for i in range(n):
    res += a[0][i]

    sum_row_1 = sum(a[0][i + 1:n])
    sum_row_2 = sum(a[1][i:n])
    if sum_row_1 <= sum_row_2:
        res += sum_row_2
        break

print(res)
# Judge status: Accepted
N = input()

if int(N) < 9:
  print(N)
  
elif len(N) == 1 or len(N) == 2:
  print(9)

elif len(N) ==3:
  print(9+int(N)-99)
  
elif len(N) == 4:
  print(9 + 900)
  
elif len(N) == 5:
  print(9+900+int(N)-9999)
  
else:
  print(90909)
# Judge status: Accepted
A, B, C, X, Y = list(map(int, input().split()))
max_AB = max(X, Y)
ans = float('inf')
for i in range(0, max_AB + 1):
    X_num = max(X - i, 0)
    Y_num = max(Y - i, 0)
    ans = min(X_num * A + Y_num * B + 2 * C * i, ans)
print(ans)
# Judge status: Wrong Answer
n = int(input())
al = list(map(int, input().split()))

foud = 0
twod = 0

for i in range(n):
    if al[i] % 4 ==0:
        foud += 1
    elif al[i] % 2 ==0:
        twod += 1
        
if (foud*2+1)+(twod//2) >=n:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N, C, K = map(int, input().split())
T = sorted(list(int(input()) for _ in range(N)))

bus = 0
pa = 1
point = T[0]

for i in T[1:]:
    pa += 1
    if point +K < i or pa > C:
        bus += 1
        pa = 1
        c = i
print(bus+1)
# Judge status: Accepted

n = list(input())
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3] or n[0] == n[1] == n[2] == n[3]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a, b = map(int, input().split())

for n in range(10000):
    xa = n * 0.08
    xb = n * 0.1
    if a == xa and b == xb:
        print(n)
        exit()
print(-1)
# Judge status: Accepted
n, x = map(int, input().split())
a = list(map(int, input().split()))

a.sort()
if x == sum(a):
    print(n)
elif x > sum(a):
    print(n-1)
else:
    for i in range(n):
        if x < a[i]:
            print(i)
            break
        x -= a[i]
# Judge status: Accepted
S = input()
print(S+'es' if S.endswith('s') else S+'s')
# Judge status: Accepted
import math 
a, b, x = map(int, input().split())

if x <= a ** 2 * b / 2:
    bottom = (x * 2 / (a * b))
    hype = math.sqrt(bottom ** 2 + b ** 2)
    print(math.degrees(math.atan2(b, bottom)))
else:
    x = a ** 2 * b - x
    height = x * 2 / (a ** 2)
    print(math.degrees(math.atan2(height, a)))
# Judge status: Wrong Answer
n = int(input())
l = [list(map(int,input().split())) for i in range(n)]
a,b,c = [list(i) for i in zip(*l)]
dp = [[0,0,0] for i in range(n+1)]
for i in range(n):
    dp[i+1][0] = max(dp[i][1]+a[i],dp[i][2]+a[i])
    dp[i+1][1] = max(dp[i][0]+b[i],dp[i][2]+b[i])
    dp[i+1][2] = max(dp[i][0]+c[i],dp[i][1],c[i])
print(max(dp[-1]))