Harryxun/stf_run huggingface dataset:
n,k = map(int,input().split())
s = input()
ans = ''
for i in len(s):
  if i == k:
    ans = ans + s[i].lower()
  ans = ans + s[i]
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
s = input()
ans = ''
for i in range(n):
    if i == k-1:
        ans = ans + s[i].lower()
    else:
        ans = ans + s[i]
print(ans)
takahashi_h, takahashi_a, aoki_h, aoki_a = map(int, input().split())

if takahashi_h // aoki_a > aoki_h // takahashi_a:
    print("Yes")
elif takahashi_h // aoki_a < aoki_h // takahashi_a:
    print("No")
else:
    takahashi_h = takahashi_h - (aoki_a * (takahashi_h // aoki_a))
    aoki_h = aoki_h - (takahashi_a * (aoki_h // takahashi_a))
    
    if aoki_h > 0 and takahashi_h == 0:
        print("No")
    else:
        print("Yes")

### FIXED CODE ###

S, W = map(int, input().split())
if S > W:
    print("safe")
else:
    print("unsafe")
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, atan, degrees
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
p = LIST()

ans = 0
i = 0
while i != N:
	if p[i] == i+1:
		ans += 1
		i += 1
	i += 1
print(ans)


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, atan, degrees
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
p = LIST()

ans = 0
i = 0
while i < N:
	if p[i] == i+1:
		ans += 1
		i += 1
	i += 1
print(ans)
N, M, P = map(int, input().split())

E = [[0, 0, 0] for n in range(M)]
for n in range(N):
    A, B, C = map(int, input().split())
    E[n][0] = A - 1
    E[n][1] = B - 1
    E[n][2] = P - C


def BellmanFord(edges, num_v, source, end):
    inf = 10 ** 8
    dist = [inf for i in range(num_v)]
    dist[source] = 0

    for i in range(num_v):
        for edge in edges:
            if dist[edge[1]] > dist[edge[0]] + edge[2]:
                dist[edge[1]] = dist[edge[0]] + edge[2]

    end1 = dist[end]
    for i in range(num_v):
        for edge in edges:
            if dist[edge[1]] > dist[edge[0]] + edge[2]:
                dist[edge[1]] = dist[edge[0]] + edge[2]

    end2 = dist[end]

    return max(0, -end1) if end1 == end2 else -1


res = BellmanFord(E, N, 0, N - 1)
print(res)


### FIXED CODE ###

N, M, P = map(int, input().split())

E = [[0, 0, 0] for m in range(M)]
for m in range(M):
    A, B, C = map(int, input().split())
    E[m][0] = A - 1
    E[m][1] = B - 1
    E[m][2] = P - C


def BellmanFord(edges, num_v, source, end):
    inf = 10 ** 12
    dist = [inf for i in range(num_v)]
    dist[source] = 0
    parent = [-1 for i in range(num_v)]

    for i in range(num_v):
        for edge in edges:
            if dist[edge[1]] > dist[edge[0]] + edge[2]:
                dist[edge[1]] = dist[edge[0]] + edge[2]
                parent[edge[1]] = edge[0]

    end1 = dist[end]
    trace1 = []
    r = end
    for n in range(num_v):
        trace1.append(r)
        r = parent[r]
        if r == -1:
            break

    for i in range(num_v):
        for edge in edges:
            if dist[edge[1]] > dist[edge[0]] + edge[2]:
                dist[edge[1]] = dist[edge[0]] + edge[2]
                parent[edge[1]] = edge[0]

    end2 = dist[end]
    trace2 = []
    r = end
    for n in range(num_v + 10):
        trace2.append(r)
        r = parent[r]
        if r == -1:
            break

    if trace2[-1] != source:
        return -1

    return max(0, -end1) if end1 == end2 else -1


res = BellmanFord(E, N, 0, N - 1)
print(res)
from collections import deque


n, m, p = map(int, input().split())
graph = [[-float('inf')] * n for i in range(n)]
for i in range(m):
    a, b, c = map(int, input().split())
    graph[a-1][b-1] = c



def dfs(graph, start, goal):
    que = deque()
    que.append(start)
    reached = set()
    while que:
        edges = que.popleft()
        for to, cost in enumerate(graph[edges]):
            if cost != -float('inf') and to not in reached:
                que.append(to)
                reached.add(to)
    if goal in reached:
        return True
    else:
        return False


dist = [-float('inf')] * n
dist[0] = 0
ans = -float('inf')
flag = True
for time in range(1, n+1):
    if not flag:
        break
    new_dist = [-float('inf')] * n
    flag = False
    for before, edges in enumerate(graph):
        for to, cost in enumerate(edges):
            if dist[before] + cost > new_dist[to]:
                new_dist[to] = dist[before] + cost
                flag = True
                if time == n:
                    update_points = []
                    update_points.append(to)
    dist = new_dist
    ans = max(0, new_dist[n-1] - time * p, ans)



flag = False
for i in update_points:
    if dfs(graph, i, n-1):
        print(-1)
        break
else:
    print(ans)

### FIXED CODE ###

from collections import deque
NegInf = -float('inf')


n, m, p = map(int, input().split())
graph = [[] for _ in range(n)]
for i in range(m):
    a, b, c = map(int, input().split())
    graph[a-1].append((b-1, c-p))


def bellman_ford(vst, graph, node_num, NegInf):
    costs = [NegInf] * node_num
    costs[0] = 0
    v_nows = set([vst])
    for _ in range(n):
        v_changeds = set()
        for v_from in v_nows:
            for v_to, cost in graph[v_from]:
                c2 = costs[v_from] + cost
                if c2 > costs[v_to]:
                    costs[v_to] = c2
                    v_changeds.add(v_to)
        v_nows = v_changeds



    if not v_changeds:
        return costs

    for i in v_nows:
        costs[i] = NegInf

    que = deque(v_nows)
    while que:
        v_from = que.popleft()
        for v_to, cost in graph[v_from]:
            if costs[v_to] != NegInf:
                costs[v_to] = NegInf
                que.append(v_to)
    return costs


costs = bellman_ford(0, graph, n, -float('inf'))
if costs[n-1] == NegInf:
    print(-1)
else:
    print(max(0, costs[n-1]))
import math


hour_hand_speed = (2 * math.pi) / (12 * 60)
minute_hand_speed = (2 * math.pi) / 60

hour_hand, minute_hand, hour, minute = list(
    map(int, input().split())
)

elapsed_time = 60 * hour + minute

hour_hand_angle = elapsed_time * hour_hand_speed
minute_hand_angle = minute * minute_hand_speed

angle_btw_hour_minute = abs(hour_hand_angle - minute_hand_angle)

distance = math.sqrt(
    hour_hand**2 + minute_hand**2 - (2 * hour_hand * minute_hand * math.cos(angle_btw_hour_minute))
)

print(distance)import math


hour_hand_speed = (2 * math.pi) / (12 * 60)
minute_hand_speed = (2 * math.pi) / 60

hour_hand, minute_hand, hour, minute = list(
    map(int, input().split())
)

elapsed_time = 60 * hour + minute

hour_hand_angle = elapsed_time * hour_hand_speed
minute_hand_angle = minute * minute_hand_speed

angle_btw_hour_minute = abs(hour_hand_angle - minute_hand_angle)

distance = math.sqrt(
    hour_hand**2 + minute_hand**2 - (2 * hour_hand * minute_hand * math.cos(angle_btw_hour_minute))
)

print(distance)

### FIXED CODE ###

import math


hour_hand_speed = (2 * math.pi) / (12 * 60)
minute_hand_speed = (2 * math.pi) / 60

hour_hand, minute_hand, hour, minute = list(
    map(int, input().split())
)

elapsed_time = 60 * hour + minute

hour_hand_angle = elapsed_time * hour_hand_speed
minute_hand_angle = minute * minute_hand_speed

angle_btw_hour_minute = abs(hour_hand_angle - minute_hand_angle)

distance = math.sqrt(
    hour_hand**2 + minute_hand**2 - (2 * hour_hand * minute_hand * math.cos(angle_btw_hour_minute))
)

print(distance)
N = int(input())
S = list(map(str, input()))

def next_char(candidate, cor_char_index, ctr):
	# print("next_char")
	# print(candidate, cor_char_index, ctr)
	char = S[cor_char_index]
	satisfy = []
	for i in candidate:
		if cor_char_index < i - ctr + 1 and i + 1 < N and S[i + 1] == char:
			satisfy.append(i + 1)
	if len(satisfy) >= 1 and cor_char_index + 1 < N:
		return next_char(satisfy, cor_char_index + 1, ctr + 1)
	else:
		return ctr
	
ret = 0
for i in range(N):
	if ret > N - i:
		break
	else:
		tmp = (next_char([j for j in range(i, N)], i, 0))
		ret = max(ret, tmp)
		
print(ret)

### FIXED CODE ###

N = int(input())
S = list(map(str, input()))

dp = [[0 for _ in range(N)] for _ in range(N)]
edge_r = N - 1
edge_d = N - 1
for i in reversed(range(N)):
	for j in reversed(range(N)):
		if i == edge_d or j == edge_r:
			if S[i] == S[j]:
				dp[i][j] = 1
			else:
				dp[i][j] = 0
		else:
			if S[i] == S[j]:
				dp[i][j] = dp[i + 1][j + 1] + 1
ans = 0
for i in range(N):
	for j in range(N):
		if i >= j:
			continue
		# ij間の距離よりもdp[i][j]が大きいならば、それはかぶってる
		tmp = min(dp[i][j], j - i)
		ans = max(tmp, ans)
		
print(ans)
a,b=map(int,input().split())
c,d=map(int,input().split())
print(a-(c+d))

### FIXED CODE ###

a,b=map(int,input().split())
C=list(map(int,input().split()))
play_day=a-sum(C)
if play_day>=0:
    print(play_day)
else:
    print("-1")
S = input()
if len(S) == 26:
    done = set()
    for i, s in enumerate(S[::-1]):
        s = ord(s)
        if done:
            if max(done) < s:
                done.add(s)
                if i == 25:
                    print(-1)
            elif i != 25:
                print(S[: -(i + 1)] + chr(min(done)))
                break
            else:
                print(chr(ord(S[0] + 1)))
        else:
            done.add(s)
else:
    for i in range(ord("a"), ord("z") + 1):
        if not (chr(i) in S):
            print(S + chr(i))
            break

### FIXED CODE ###

S = input()
if len(S) == 26:
    done = set()
    for i, s in enumerate(S[::-1]):
        s = ord(s)
        if done:
            if max(done) < s:
                done.add(s)
                if i == 25:
                    print(-1)
            elif i != 25:
                l = 30
                for d in done:
                    if l > abs(d - s) and s < d:
                        x = d
                        l = d - s
                print(S[: -(i + 1)] + chr(x))
                break
            else:
                print(chr(ord(S[0]) + 1))
        else:
            done.add(s)
else:
    for i in range(ord("a"), ord("z") + 1):
        if not (chr(i) in S):
            print(S + chr(i))
            break
n = int(input())
# bを奇数の数と仮定して
b = 'math.ceil(n/2)'
#　奇数/全体ってやればいいのかな？
N　= b/ｎ

### FIXED CODE ###

import math
n = int(input())
print(math.ceil(n/2)/n)
n=int(input())
s,t=input().sprit()
s=list(input())
t=list(input())
a=[]
for i in range(0,n):
  a.append(s[i])
  a.append(t[i])
print(''.join(a))

### FIXED CODE ###

n=int(input())
s,t=list(input().split())
a=[]
for i in range(0,n):
  a.append(s[i])
  a.append(t[i])
print(''.join(a))
n,l=map(int,input().split())
s=[int(input()) for _ in range(n)]
s.sort()

for i in s:
  print(i,end="")


### FIXED CODE ###

n,l=map(int,input().split())
s=[input() for _ in range(n)]
s.sort()

for i in s:
  print(i,end="")
n = int(input())
num = list(map(int,input().split(" ")))
 
s = num[0]
 
for i range(1,n):
  s = s * num[i] 
 
print(s)

### FIXED CODE ###

n = int(input())
num = list(map(int,input().split(" ")))
 
zero=num.count(0)
z= 10 **18
if zero != 0:
  print(0)
else:
  s = num[0]
  for i in range(1,n):
    s = s * num[i]
    if s > z:
      s=-1
      break
  print(s)
s=input()
wether=['Sunny', 'Cloudy', 'Rainy','Sunny']
for i in wether:
  if s==i:
    print(wether[i+1])
    break
    
    

### FIXED CODE ###

s=input()
wether=['Sunny', 'Cloudy', 'Rainy','Sunny']
for i in range(len(wether)):
  if s==wether[i]:
    print(wether[i+1])
    break
W,H,N = (int(i) for i in input().split())

l = [list(map(int, input().split())) for i in range(N)] 

x_min = min([i[0] for i in l if i[2] == 1])
x_max = max([i[0] for i in l if i[2] == 2])
y_min = min([i[1] for i in l if i[2] == 3])
y_max = max([i[1] for i in l if i[2] == 4])

print((W - max(0,x_max-x_min)) * (H - max(0,y_max-y_min)))


### FIXED CODE ###

W,H,N = (int(i) for i in input().split())

l = [list(map(int, input().split())) for i in range(N)] 

x_max = max([i[0] if i[2] == 1 else 0 for i in l])
x_min = min([i[0] if i[2] == 2 else W for i in l])
y_max = max([i[1] if i[2] == 3 else 0 for i in l])
y_min = min([i[1] if i[2] == 4 else H for i in l])

x = min(x_max+(W-x_min),W)
y = min(y_max+(H-y_min),H)

print(W*H - x*H - y*W + x*y)
from collections import deque

def bfs():
    d = [[float("inf")] * w for _ in range(h)]

    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]

    que = deque([])
    que.append((sx, sy))
    d[sx][sy] = 0

    while que:
        p = que.popleft()
        if p[0] == gx and p[1] == gy:
            break

        for i in range(4):
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]

            if 0 <= nx < w and 0 <= ny < h and maze[nx][ny] != "#" and d[nx][ny] == float("inf"):
                que.append((nx, ny))
                d[nx][ny] = d[p[0]][p[1]] + 1
    
    return d[gx][gy]

h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]
sx, sy = 0, 0
gx, gy = h-1, w-1

white = 0
for i in range(h):
    for j in range(w):
        if maze[i][j] == ".":
            white += 1

res = bfs()

if 0 < res < float("inf"):
    print(white-res-1)
else:
    print(-1)

### FIXED CODE ###

from collections import deque

def bfs():
    d = [[float("inf")] * w for i in range(h)]

    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]

    que = deque([])
    que.append((sx, sy))
    d[sx][sy] = 0

    while que:
        p = que.popleft()
        if p[0] == gx and p[1] == gy:
            break

        for i in range(4):
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]

            if 0 <= nx < h and 0 <= ny < w and maze[nx][ny] != "#" and d[nx][ny] == float("inf"):
                que.append((nx, ny))
                d[nx][ny] = d[p[0]][p[1]] + 1
    
    return d[gx][gy]

h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]
sx, sy = 0, 0
gx, gy = h-1, w-1

white = 0
for i in range(h):
    for j in range(w):
        if maze[i][j] == ".":
            white += 1

res = bfs()

if 0 < res < float("inf"):
    print(white-res-1)
else:
    print(-1)
N = int(input())

e = [ [] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a-=1
    b-=1
    e[a].append(b)
    e[b].append(a)

col = [ -1 for i in range(N)]
col[0] = 0
def dfs(n,c):

    for v in e[n]:
        if col[v] == -1:
            col[v] = c + 1
            dfs(v,c+1)

dfs(0,0)

colf = [ -1 for i in range(N)]
colf[0] = 0
def dfsf(n,c):

    for v in e[n]:
        if v == N - 1:
            #colf[v] = c + 1
            continue
        elif colf[v] == -1:
            colf[v] = c + 1
            dfsf(v,c+1)
dfsf(0,0)

cols = [ -1 for i in range(N)]
cols[N-1] = 0
def dfss(n,c):

    for v in e[n]:
        if v == 0:
            #cols[v] = c + 1
            continue
        elif cols[v] == -1:
            cols[v] = c + 1
            dfss(v,c+1)
dfss(N-1,0)

fennec,snuke = 0,0

for i in range(N):
    if colf[i] != -1:
        fennec += 1
    if cols[i] != -1:
        snuke += 1

t = col[N-1] - 1
if t % 2 == 0:
    fennec += (t//2)
    snuke += (t//2)
else:
    fennec += (t//2) + 1
    snuke += (t//2)
    
if fennec > snuke:
    print("Fennec")
else:
    print("Snuke")





### FIXED CODE ###

import sys

p = []
path = [ 0 for i in range(10**5+1)]
def main():

    sys.setrecursionlimit(1000000)

    N = int(input())

    e = [ [] for i in range(N)]
    for i in range(N-1):
        a,b = map(int,input().split())
        a-=1
        b-=1
        e[a].append(b)
        e[b].append(a)

    col = [ -1 for i in range(N)]
    col[0] = 0
    
    #def dfs(n,c,path):
    def dfs(n,c):
        global p
        #path =  path  + [n]
        #path.append(n)
        #print(path)
        if n == N - 1:
            p = path
        path[c] = n
        for v in e[n]:
            if col[v] == -1:
                col[v] = c + 1
                dfs(v,c+1)
                #dfs(v,c+1,path)
                if p:
                    return
    dfs(0,0)
    #print(p[:N+10])
    #dfs(0,0,[])

    t = col[N-1] + 1
    if t % 2 ==0:
        sn = p[t//2]
    else:
        sn = p[t//2+1]


    colfn = [ -1 for i in range(N)]
    colfn[0] = 0
    def dfs2(n,c):

        for v in e[n]:
            if v == sn:
                continue
            elif colfn[v] == -1:
                colfn[v] = c + 1
                dfs2(v,c+1)

    dfs2(0,0)

    fennec = -1
    for i in range(N):
        if colfn[i] != -1:
            fennec += 1

    snuke = N - fennec - 2
    if fennec > snuke:
        print("Fennec")
    else:
        print("Snuke")



if __name__ == '__main__':
    main()
s=input()
if s=="Sunny":
  print("Cloudy")
elif s=="Cloudy":
  print("Rainy")
else:
  print(Sunny)

### FIXED CODE ###

s=input()
if s=="Sunny":
  print("Cloudy")
elif s=="Cloudy":
  print("Rainy")
else:
  print("Sunny")
S = input()
stack = [S]
ans = int(S)
checked = []
while True:
  str_num = stack.pop()
  if len(str_num) <= 1:
    continue
  for i in range(len(str_num)):
    str1 = str_num[:i]
    str2 = str_num[i:]
    if not str1 in checked:
      checked.append(str1)
      ans += int(str1)
      stack.append(str1)
    if not str2 in checked:
      checked.append(str2)
      ans += int(str2)
      stack.append(str2)
print(ans)


### FIXED CODE ###

S = input()
ans = 0
for num in range(2**((len(S)-1))):
  before = 0
  nums = []
  for i in range(len(S)-1):
    if num>>i&1:
      nums.append(int(S[before:i+1]))
      before = i+1
  nums.append(int(S[before:]))
  ans += sum(nums)
print(ans)
n,k = map(int,input().split())
a = [input().split() for i in range(n)]

d = {}
for i in a:
  if i in d:
    d[a] += 1
  else:
    d[a] = 1
    
    
d = sorted(d,values())
if len(d) > k:
  ans = 0
  for i in range(len(d)-k):
    ans += d[i]
  print(ans)
else:
  print(0)
  
  


### FIXED CODE ###

n,k = map(int, input().split())
A = [int(x) for x in input().split()]
d = {}
for a in A:
  if a in d:
    d[a] +=1
  else:
    d[a] =1
    
d =sorted(d.values())
if len(d) > k:
  ans = 0
  for i in range(len(d)-k):
    ans += d[i]
  print(ans)
else:
  print(0)
n, k = [int(elem) for elem in input().split()]
ps = [int(elem) for elem in input().split()]

exs = []
for p in ps:
  exs.append((1.0+p)/2)
res = [sum(exs[i:i+k]) for i in range(0, n-k)]
print(max(res))

### FIXED CODE ###

n, k = [int(elem) for elem in input().split()]
ps = [int(elem) for elem in input().split()]

sum_max = 0
for i in range(k - 1, n):
    if i == k - 1:
        sum_now = sum(ps[:i + 1])
    else:
        sum_now = sum_now + ps[i] - ps[i - k]
    sum_max = max(sum_max, sum_now)
    
print(float(sum_max + k) / 2)
a,b = map(int, input().split())
print(max(a+b,a*b,a-

### FIXED CODE ###

a,b = map(int, input().split())
print(max(a+b,a*b,a-b))
x, y = int(input())
print((x*x)-y)


### FIXED CODE ###

x, y = [int(input()) for i in range(2)]
print(x*x - y)
N = int(input())

N_list = list(range(1, N+1, 1))
N_lista = []
for i in range(N):
  if i != (N - 1):
    N_lista.append(N_list[i+1])
  else:
    N_lista.append(N_list[0])

mod_sum = 0

for i in range(N):
  mod_sum += (i + 1) % N_lista[i]
  
print(mod_sum)

### FIXED CODE ###

N = int(input())
    
print((N - 1) * N // 2)
list=input().split()

num=int(list[0]+list[1])

num_squrt=math.sqrt(num)

if num_squrt.is_integer()==True:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import math 

list=input().split()

num=int(list[0]+list[1])

num_squrt=math.sqrt(num)

if num_squrt.is_integer()==True:
    print("Yes")
else:
    print("No")
n=int(input())
li=li(map(int,input().split()))
print(max(li)-min(li))

### FIXED CODE ###

n=int(input())
li=list(map(int,input().split()))
print(max(li)-min(li))
import re
s=input()
m=0
for i in range(len(s)//2):
  dst = re.sub(r'01|10', "", s)
  dst = re.sub(r'000000111111', "", dst)
  if dst == s:
    break
  m += len(s) - len(dst)
  s=dst
print(m

### FIXED CODE ###

s=input();print(min(s.count("0"), s.count("1"))*2)
N = int(input())
if N % 2 == 0:
  print(2/N)
else:
  print((N//2) / (N//2)+1)

### FIXED CODE ###

N = int(input())
print(((N + 1) // 2) / N)
n=int(input())
s={"M":0,"A":0,"R":0,"C":0,"H":0}
for i in range(n):
    v=input()
    if v[0] in s:
        s[v[0]]+=1
l=s.values()
sum=0
for a in range(5):
    for b in range(a+1,5):
        for c in range(b+1,5):
            sum+=l[a]*l[b]*l[c]         
print(sum)

### FIXED CODE ###

n=int(input())
s={"M":0,"A":0,"R":0,"C":0,"H":0}
for i in range(n):
    v=input()
    if v[0] in s:
        s[v[0]]+=1
l=list(s.values())
ans=0
for a in range(5):
    for b in range(a+1,5):
        for c in range(b+1,5):
            ans+=l[a]*l[b]*l[c]         
print(ans)
x, y = (max(4 - int(i), 0) or i in input().split())
print((x + y + 4*(x==y==3)) * 10**5)

### FIXED CODE ###

x, y = (max(4 - int(i), 0) for i in input().split())
print((x + y + 4*(x==y==3)) * 10**5)
N,M =map(int,input().split())
a =list( map(int,input().split()) )
if N-sum(a) >=0:
    print(N-sum(a))
else :
    print('-1') 

### FIXED CODE ###

import math
R = int(input())
print(2*R*math.pi)
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)


N = int(input())

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

print(gcd(A))



### FIXED CODE ###

N = int(input())

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

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
        
a = A[0]
for i in range(N):
    a = gcd(a,A[i])

print(a)
N,Q = list(map(int, input().split()))
S = str(input())
lr=[]
for i in range(Q):
    lr.append(list(map(int, input().split())))


count=[0 for i in range(N)]
ind=0
for i in range(N-1):
    if S[i]=="A" and S[i+1]=="C":
      	ind+=1
        count[i+1]+=count[i+1]+ind

for i,j in lr:
    print(count[j-1]-count[i-1])


### FIXED CODE ###

N,Q = list(map(int, input().split()))
S = str(input())
lr=[]
for i in range(Q):
    lr.append(list(map(int, input().split())))


count=[0 for i in range(N)]
ind=0
for i in range(N-1):
    if S[i]=="A" and S[i+1]=="C":
        ind+=1
    count[i+1]+=count[i+1]+ind

for i,j in lr:
    print(count[j-1]-count[i-1])
s = input()
s_f = int(s[0]+s[1])
s_b = int(s[2]+s[3])

#print(s_f)
#print(s_b)
if s_f==0 or s_b==0:
    print('NA')
elif s_f<=12 and s_b<=12:
    print("AMBIGUOUS")
elif s_f<=12 and s_b>12:
    print('MMYY')
elif s_f>12 and s_b<=12:
    print('YYMM')
elif s_f>12 and s_b>12
    print('NA')
    
    

### FIXED CODE ###

def solve(yy,mm):
    if 1<=yy<=12:
        if 1 <= mm <=12:
            return 'AMBIGUOUS'
        else:
            return 'MMYY'
    else:
        if 1<= mm <= 12:
            return 'YYMM'
        else:
            return "NA"


s = input()
yy = int(s[:2])
mm = int(s[2:])
print(solve(yy,mm))