qyliang/CodeNanoFix huggingface dataset:
Buggy code:
#ABC126 B

S = list(map(int,input()))
if S[0]*10 + S[1] <= 12 and S[2]*10 + S[3] <= 12:
    print("AMBIGUOUS")
elif S[0]*10 + S[1] <= 12 and S[2]*10 + S[3] > 12:
    print("MMYY")
elif S[0]*10 + S[1] > 12 and S[2]*10 + S[3] <= 12:
    print("YYMM")
elif S[0]*10 + S[1] > 12 and S[2]*10 + S[3] > 12:
    print("NA")

Fixed code:
#ABC126 B

S = list(map(int,input()))
if 1 <= S[0]*10 + S[1] <= 12 and 1 <= S[2]*10 + S[3] <= 12:
    print("AMBIGUOUS")
elif 1 <= S[0]*10 + S[1] <= 12 and (S[2]*10 + S[3] > 12 or S[2]*10 + S[3] == 0):
    print("MMYY")
elif (S[0]*10 + S[1] > 12 or S[0]*10 + S[1] == 0)  and  1 <= S[2]*10 + S[3] <= 12:
    print("YYMM")
elif (S[0]*10 + S[1] > 12 or S[0]*10 + S[1] == 0) and (S[2]*10 + S[3] > 12 or S[2]*10 + S[3] == 0):
    print("NA")
Buggy code:
def main():
    s = input()
    up = int(s[0:2])
    lo = int(s[-2:])
    if can_month(up):
        if can_month(lo):
            print('AMBIGUOUS')
        else:
            print('MMYY')

    else:
        if can_month(lo):
            print('YYMM')
        else:
            print('AMBIGUOUS')


def can_month(v):
    if v > 0 and v <= 12:
        return True
    else:
        return False

if __name__ == '__main__':
    main()



Fixed code:
def main():
    s = input()
    up = int(s[0:2])
    lo = int(s[-2:])
    if can_month(up):
        if can_month(lo):
            print('AMBIGUOUS')
        else:
            print('MMYY')

    else:
        if can_month(lo):
            print('YYMM')
        else:
            print('NA')


def can_month(v):
    if v > 0 and v <= 12:
        return True
    else:
        return False

if __name__ == '__main__':
    main()
Buggy code:
s=input()
f=int(s[:2])
b=int(s[2:])
print(f,b)
if f>13:
	if 0<b and b<13:
		print("YYMM")
	else:
		print("NA")
elif 0<f:
	if 0<b and b<13:
		print("AMBIGUOUS")
	else:
		print("MMYY")
else:
	print("NA")

Fixed code:
s=input()
f=int(s[:2])
b=int(s[2:])
if f>=13 or f==0:
	if 0<b and b<13:
		print("YYMM")
	else:
		print("NA")
elif 0<f and f<13:
	if 0<b and b<13:
		print("AMBIGUOUS")
	else:
		print("MMYY")
else:
	print("NA")
Buggy code:
S = input()
if int(S[:2]) < 13:
    if int(S[2:]) < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if int(S[2:]) < 13:
        print('YYMM')
    else:
        print('NA')


Fixed code:
S = input()
if 0 < int(S[:2]) < 13:
    if 0 < int(S[2:]) < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 0 < int(S[2:]) < 13:
        print('YYMM')
    else:
        print('NA')
Buggy code:
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("MMYY")
  else:
    if(0<a//100<13):
      print("YYMM")
    else:
      print("NA")

Fixed code:
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("YYMM")
else:
    if(0<a//100<13):
      print("MMYY")
    else:
      print("NA")
Buggy code:
s=input()
a=int(s[:2])
b=int(s[2:])
if a==0:
  if 1<=b<=12:
    print("MMYY")
  else:
    print("NA")
elif 1<=a<=12:
  if 1<=b<=12:
    print("AMBIGUOUS")
  else:
    print("NA")
else:
    if 1<=b<=12:
    print("YYMM")
  else:
    print("NA")

Fixed code:
s=input()
a=int(s[:2])
b=int(s[2:])
if a==0:
  if 1<=b<=12:
    print("YYMM")
  else:
    print("NA")
elif 1<=a<=12:
  if 1<=b<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
    if 1<=b<=12:
      print("YYMM")
    else:
      print("NA")
Buggy code:
s=input()
n=int(s[:2])
m=int(s[2:])
if 1<=n<=12:
  if 1<=m<=12:
    print("ambiguous".upper())
  else:
    print("MMYY")
    exit()
if 1<=m<13:
  print("YYMM")
  exit()
print("NA")

Fixed code:
s=input()
n=int(s[:2])
m=int(s[2:])
if 1<=n<=12:
  if 1<=m<=12:
    print("ambiguous".upper())
    exit()
  else:
    print("MMYY")
    exit()
if 1<=m<13:
  print("YYMM")
  exit()
print("NA")
Buggy code:
import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    head = int(inputs[0][:2])
    tail = int(inputs[0][2:])

    if head == 0 or tail == 0:
        return "NA"

    if head >= 1 and head <= 12:
        if tail >= 1 and head <= 12:
            return "AMBIGUOUS"
        return "MMYY"

    if tail >= 1 and head <= 12:
        return "YYMM"


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)


Fixed code:
import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    head = int(inputs[0][:2])
    tail = int(inputs[0][2:])

    if head >= 1 and head <= 12:
        if tail >= 1 and tail <= 12:
            return "AMBIGUOUS"
        else:
            return "MMYY"

    if tail >= 1 and tail <= 12:
        return "YYMM"

    return "NA"


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)
Buggy code:
s=str(input())
a=int(s[:2])
b=int(s[2:])
if a==0 or a>=13:
    astr='YY'
else:
    astr='MM'

if b==0 or a>=13:
    bstr='YY'
else:
    bstr='MM'

ans=astr+bstr
 
if ans=='YYYY':
    print('NA')
elif ans=='MMMM':
    print('AMBIGUOS')
else:
    print(ans)


Fixed code:
s=str(input())
a=int(s[:2])
b=int(s[2:])
if a==0 or a>=13:
    astr='YY'
else:
    astr='MM'

if b==0 or b>=13:
    bstr='YY'
else:
    bstr='MM'

ans=astr+bstr


if ans=='YYYY':
    print('NA')
elif ans=='MMMM':
    print('AMBIGUOUS')
else:
    print(ans)
Buggy code:
S = int(input())
A = S//100
B = S-(A*100)
if B >12:
    if  A > 13:    
        print("YYMM")
    else A <=12:
        print("MMYY")
elif 1<= B <=12:
    if A >13:
        print("YYMM")
    else A <=12:
        print("AMBIGUOUS")
else :
    print("NA")


Fixed code:
S = int(input())
A = S//100
B = S-(A*100)
if B ==0 or B >= 13:
    if 1<= A <=12:    
        print("MMYY")
    else:
        print("NA")
elif 1<= B <=12:
    if 1<= A <=12:
        print("AMBIGUOUS")
    elif A >= 13:
        print("YYMM")
    elif A == 0:      
        print("YYMM")
    else:
        print("NA")
else:
    print("NA")
Buggy code:
s=input()
t=int(s[0]+s[1])
u=int(s[2]+s[3])
if t<=12 and u<=12:
  print('AMBIGUOUS')
elif t>=13 and u>=13:
  print('NA')
elif t>=13:
  print('YYMM')
else:
  print('MMYY')

Fixed code:
s=input()
t=int(s[0]+s[1])
u=int(s[2]+s[3])
if 0<t<=12 and 0<u<=12:
  print('AMBIGUOUS')
elif (t>=13 or t==0) and (u>=13 or u==0):
  print('NA')
elif 0<u<=12:
  print('YYMM')
elif 0<t<=12: 
  print('MMYY')
Buggy code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])

if 1 <= s1 <= 12:
  if 1 <= s2 <= 12:
    print("ANBIGOUS")
  else:
    print("MMYY")
else:
  if 1 <= s2 <= 12:
    print("YYMM")
    exit()
  else:
    print("NA")

Fixed code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])

if 1 <= s1 <= 12:
  if 1 <= s2 <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1 <= s2 <= 12:
    print("YYMM")
    exit()
  else:
    print("NA")
Buggy code:
S = str(input())
front = int(S[:2])
back = int(S[2:])
S_list = list(S)

if front > 12 or front == 0:
    if 1 < back <= 12 :
        print("YYMM")
    else:
        print("NA")
elif front <= 12 and front == 0:
    if back <= 12 or back > 1: 
        print("AMBIGUOUS")
    else:
        print("MMYY")

Fixed code:
S = str(input())
front = int(S[:2])
back = int(S[2:])
S_list = list(S)

if front > 12 or front == 0:
    if 0 < back <= 12 :
        print("YYMM")
    else:
        print("NA")
elif front <= 12 or front == 0:
    if 0 < back <= 12: 
        print("AMBIGUOUS")
    else:
        print("MMYY")
Buggy code:
def main():
    inp=input()
    ch1=int(inp[0:2])
    ch2=int(inp[2:])
    if inp[0]==0:
        ch1=int(inp[1])
    if inp[2]==0:
        ch2=int(inp[-1])
    if ch1<=12 and ch1>=1:
        if ch2<=12 and ch2>=1 and ch2<=12 and ch2>=1:
            print("AMBIGUOUS")
            return
        elif ch2<=12 or ch2>=1:
            print("MMYY")
            return
    if ch1>12 or ch1<1:
        if ch2<=12 and ch2>=1:
            print("YYMM")
            return
    else:
        print("NA")
        return
main()

Fixed code:
def main():
    inp=input()
    ch1=int(inp[0:2])
    ch2=int(inp[2:])
    if inp[0]==0:
        ch1=int(inp[1])
    if inp[2]==0:
        ch2=int(inp[-1])
    if ch1<=12 and ch1>=1:
        if ch2<=12 and ch2>=1 and ch2<=12 and ch2>=1:
            print("AMBIGUOUS")
            return
        elif ch2<=12 or ch2>=1:
            print("MMYY")
            return
    if ch1>12 or ch1<1:
        if ch2<=12 and ch2>=1:
            print("YYMM")
            return
        else:
            print("NA")
            return
main()
Buggy code:
a = input()
a1 = int(a[:2])
a2 = int(a[2:])
if a1 <= 12 and a2 <= 12:
    print('AMBIGUOUS')
elif a1 <= 12:
    print('MMYY')
elif a2 <= 12:
    print('YYMM')
else:
    print('NA')

Fixed code:
a = input()
a1 = int(a[:2])
a2 = int(a[2:])

if a1 <= 12 and a2 <= 12 and a1 >= 1 and a2 >= 1:
    print('AMBIGUOUS')
elif a1 <= 12 and a1 >= 1:
    print('MMYY')
elif a2 <= 12 and a2 >= 1:
    print('YYMM')
else:
    print('NA')
Buggy code:
s=int(input())
a=s//100
b=s%100
if a<=12 and a>=1 and b<=12 and b>=1:
  print("AMBIGUOUS")
elif a>=13 and b<=12:
  print("YYMM")
elif a<=12 and b>=13:
  print("MMYY")
else:
  print("NA")

Fixed code:
s=int(input())
a=s//100
b=s%100
if a<=12 and a>=1 and b<=12 and b>=1:
  print("AMBIGUOUS")
elif (a>=13 or a==0) and b<=12 and b>=1:
  print("YYMM")
elif a<=12 and a>=1 and (b>=13 or b==0):
  print("MMYY")
else:
  print("NA")
Buggy code:
s = input()
a = int(s[:2])
b = int(s[2:])
f_yymm = False
f_mmyy = False

if 1 <= a <= 12:
  f_yymm = True
if 1 <= b <= 12:
  f_mmyy = True:
    
if f_yymm and f_mmyy:
  print("AMBIGUOUS")
elif f_yymm and (not f_mmyy):
  print("YYMM")
elif (not f_yymm) and f_mmyy:
  print("MMYY")
else:
  print("NA")
  

Fixed code:
s = input()
a = int(s[:2])
b = int(s[2:])
f_yymm = False
f_mmyy = False

if 1 <= a <= 12:
  f_mmyy = True
if 1 <= b <= 12:
  f_yymm = True
    
if f_yymm and f_mmyy:
  print("AMBIGUOUS")
elif f_yymm and (not f_mmyy):
  print("YYMM")
elif (not f_yymm) and f_mmyy:
  print("MMYY")
else:
  print("NA")
Buggy code:
def main():
	s = input()
	aa = int(s[:2])
	bb = int(s[2:])
	ans = ""
	if (aa <= 12) and (aa > 0):
		if (bb <= 12) and (bb > 0):
			ans = "AMBIGUOUS"
		else:
			ans = "MMYY"
	else:
		if (bb <= 12) or (bb > 0):
			ans = "YYMM"
		else:
			ans = "NA"
	print(ans)

main()

Fixed code:
def main():
	s = input()
	aa = int(s[:2])
	bb = int(s[2:])
	ans = ""
	if (aa <= 12) and (aa > 0):
		if (bb <= 12) and (bb > 0):
			ans = "AMBIGUOUS"
		else:
			ans = "MMYY"
	else:
		if (bb <= 12) and (bb > 0):
			ans = "YYMM"
		else:
			ans = "NA"
	print(ans)

main()
Buggy code:
# ABC126B

s = input()
aa = s // 100
bb = s %  100
if 1 <= aa and aa <= 12:
    if 1 <= bb and bb <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= bb and bb <= 12:
        print('YYMM')
    else:
        print('NA')


Fixed code:
# ABC126B

s = int(input())
aa = s // 100
bb = s %  100
if 1 <= aa and aa <= 12:
    if 1 <= bb and bb <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= bb and bb <= 12:
        print('YYMM')
    else:
        print('NA')
Buggy code:
A = str(input())
AC = list(A)
AB = int(A[0] + A[1])
AC = int(A[2] + A[3])

if 1 <= AB <= 12 and 1 <= AC <= 12:
    print("AMBIGUOUS")
elif AB > 13:
    print("YYMM")
elif AC > 13:
    print("MMYY")
else:
    print("NA")

Fixed code:
A = str(input())
AC = list(A)
AB = int(A[0] + A[1])
AC = int(A[2] + A[3])

if 1 <= AB <= 12 and 1 <= AC <= 12:
    print("AMBIGUOUS")
elif 1 <= AB <= 12:
    print("MMYY")
elif 1 <= AC <= 12:
    print("YYMM")
else:
    print("NA")
Buggy code:
s=input()
s1=int(s[:2])
s2=int(s[2:4])
if s1>12 :
  if s2>0 :
    if s2<=12 :
      print("YYMM")
    else :
      print("NA")
  else :
    print("NA")
elif s1>0:
  if s2>0 :
    if s2<=12 :
      print("AMBIGUOU")
    else :
      print("MMYY")
  else :
    print("MMYY")
else :
  if s2>0 :
    if s2<=12 :
      print("YYMM")
    else :
      print("NA")
  else :
    print("NA")

Fixed code:
s=input()
s1=int(s[:2])
s2=int(s[2:4])
if s1>12 :
  if s2>0 :
    if s2<=12 :
      print("YYMM")
    else :
      print("NA")
  else :
    print("NA")
elif s1>0:
  if s2>0 :
    if s2<=12 :
      print("AMBIGUOUS")
    else :
      print("MMYY")
  else :
    print("MMYY")
else :
  if s2>0 :
    if s2<=12 :
      print("YYMM")
    else :
      print("NA")
  else :
    print("NA")
Buggy code:
n=input()
l,r=int(n[:2]),int(n[2:])
if r>12 and l<=12:
  print("MMYY")
elif r<=12 and l>12:
  print("YYMM")
elif r<=12 and l<=12:
  print("AMBIGUOUS")
else:
  print("NA")

Fixed code:
n=input()
l,r=int(n[:2]),int(n[2:])
if (r>12 or r==0) and l<=12 and l>0:
  print("MMYY")
elif r<=12 and r>0 and (l>12 or l==0):
  print("YYMM")
elif r<=12 and l<=12 and r>0 and l>0:
  print("AMBIGUOUS")
else:
  print("NA")
Buggy code:
#coding: utf-8
S = input()
year = 19
month = 12
mae, ushiro = S[:2], S[2:]
if 0 < mae <= month and 0 < ushiro <= month:
	print("AMBIGUOUS")
elif 0 < mae <= month and 0 < ushiro <= year:
	print("MMYY")
elif 0 < mae <= year and 0 < ushiro <= month:
	print("YYMM")
else:
	print("NA")

Fixed code:
#coding: utf-8
S = input()
year = 99
month = 12
mae, ushiro = int(S[:2]), int(S[2:])
if 0 < mae <= month and 0 < ushiro <= month:
	print("AMBIGUOUS")
elif 0 < mae <= month and 0 <= ushiro <= year:
	print("MMYY")
elif 0 <= mae <= year and 0 < ushiro <= month:
	print("YYMM")
else:
	print("NA")
Buggy code:
def judge_format(text):
    former, latter = int(text[:2]), int(text[2:])
    if 1 <= former <= 12 and latter > 12 or latter == 0:
        return 'MMYY'
    elif 1 <= latter <= 12 and former > 12 or former == 0:
        return 'YYMM'
    elif 1 <= former <= 12 and 1 <= latter <= 12:
        return 'AMBIGUOUS'
    else:
        return 'NA'


def main():
    s = input()
    print(judge_format(s))


main()

Fixed code:
def judge_format(text):
    former, latter = int(text[:2]), int(text[2:])
    if 1 <= former <= 12 and (latter == 0 or latter > 12):
        return 'MMYY'
    elif 1 <= latter <= 12 and (former == 0 or former > 12):
        return 'YYMM'
    elif 1 <= former <= 12 and 1 <= latter <= 12:
        return 'AMBIGUOUS'
    else:
        return 'NA'
    

def main():
    s = input()
    print(judge_format(s))


main()
Buggy code:
s = list(map(int, input()))
l = [0]*2
l[0] = s[0]*10 + s[1]
l[1] = s[2]*10 + s[3]

F = False
L = False

if l[0] <= 12:
  F = True
if l[1] <= 12:
  L = True

if F == True and L == True:
  print('AMBIGUOUS')

elif F == True:
  print('MMYY')

elif L == True:
  print('YYMM')

else:
  print('NA')

Fixed code:
s = list(map(int, input()))
l = [0]*2
l[0] = s[0]*10 + s[1]
l[1] = s[2]*10 + s[3]

F = False
L = False

if 0 < l[0] <= 12:
  F = True
if 0 < l[1] <= 12:
  L = True

if F == True and L == True:
  print('AMBIGUOUS')

elif F == True:
  print('MMYY')

elif L == True:
  print('YYMM')

else:
  print('NA')
Buggy code:
s = (input())
a= s[0:2]
b= s[2:4]
a = int(a)
b= int(b)
if a == 0 or b == 0:
  if b!= 0 and a<13:
    print('YYMM')
  elif a!= 0 and b<13:
    print('MMYY')
  else:
    print('NA')
elif a<13 or b<13:
  if a>12:
    print('YYMM')
  elif b>12:
    print('MMYY')
  else:
    print('AMBIGUOUS')

Fixed code:
s = (input())
a= s[0:2]
b= s[2:4]
a = int(a)
b= int(b)
if a == 0 or b == 0:
  if b!= 0 and b<13:
    print('YYMM')
  elif a!= 0 and a<13:
    print('MMYY')
  else:
    print('NA')
elif a<13 or b<13:
  if a>12:
    print('YYMM')
  elif b>12:
    print('MMYY')
  else:
    print('AMBIGUOUS')
else:
  print('NA')
Buggy code:
S = list(input())
A = int("".join([S[0],S[1]]))
B = int("".join([S[2],S[3]]))


if 1 <= A <= 12:
    if 1 <= B <= 12:
        print("AMBIGUOS")
    else:
        print("MMYY")
else:
    if 1 <= B <= 12:
        print("YYMM")
    else:
        print("NA")

Fixed code:
S = list(input())
A = int("".join([S[0],S[1]]))
B = int("".join([S[2],S[3]]))


if 1 <= A <= 12:
    if 1 <= B <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1 <= B <= 12:
        print("YYMM")
    else:
        print("NA")
Buggy code:
#B
# S = input()
S = "1700"
str_1 = int(S[:2])
str_2 = int(S[2:])

def judge_month(i):
    if i >= 1 and i <= 12:
        judge = True
    else:
        judge = False
    return judge
judge_1 = judge_month(str_1)
judge_2 = judge_month(str_2)
if judge_1 and judge_2:
    print("AMBIGUOUS")
elif judge_1:
    print("MMYY")
elif judge_2:
    print("YYMM")
else:
    print("NA")


Fixed code:
#B
S = input()
str_1 = int(S[:2])
str_2 = int(S[2:])

def judge_month(i):
    if i >= 1 and i <= 12:
        judge = True
    else:
        judge = False
    return judge
judge_1 = judge_month(str_1)
judge_2 = judge_month(str_2)
if judge_1 and judge_2:
    print("AMBIGUOUS")
elif judge_1:
    print("MMYY")
elif judge_2:
    print("YYMM")
else:
    print("NA")
Buggy code:
s=int(input())
x=s//100
y=s-x*100

if x*y=0:
  print("NA")

else:
  if x<13:
    if y<13:
      print("AMBIGUOUS")
    else:
      print("MMYY")
     
  else:
    if y<13:
      print("YYMM")
    else:
      print("NA")

Fixed code:
s=int(input())
x=s//100
y=s-x*100




if x>0 and x<13:
  if y>0 and y<13:
    print("AMBIGUOUS")
  else:
    print("MMYY")
     
else:
  if y>0 and y<13:
    print("YYMM")
  else:
    print("NA")
Buggy code:
s=input()
if (int(s[0]+s[1])>12 or  or int(s[0]+s[1])==00) and int(s[2]+s[3])<=12 and int(s[2]+s[3])!=00:
    print("YYMM")
elif int(s[0]+s[1])<=12 and( int(s[2]+s[3])>12 or int(s[2]+s[3])==00) and int(s[0]+s[1])!=00:
    print("MMYY")
elif int(s[0]+s[1])<=12 and int(s[2]+s[3])<=12 and (int(s[0]+s[1])!=00 or int(s[2]+s[3])!=00):
    print("AMBIGUOUS")
else:
    print("NA")

Fixed code:
s=input()
if (int(s[0]+s[1])>12 or int(s[0]+s[1])==00) and int(s[2]+s[3])<=12 and int(s[2]+s[3])!=00:
    print("YYMM")
elif int(s[0]+s[1])<=12 and( int(s[2]+s[3])>12 or int(s[2]+s[3])==00) and int(s[0]+s[1])!=00:
    print("MMYY")
elif int(s[0]+s[1])<=12 and int(s[2]+s[3])<=12 and (int(s[0]+s[1])!=00 or int(s[2]+s[3])!=00):
    print("AMBIGUOUS")
else:
    print("NA")
Buggy code:
s=input()
strdata=list(s)
data=list(map(int,strdata))
FF=10*data[0]+data[1]
LL=10*data[2]+data[3]
if 12<FF and LL<13 and 0<LL and FF<19:
    print("YYMM")
elif 12<LL and FF<13 and 0<FF:
    print("MMYY")
elif FF<13 and LL<13 and 0<FF and 0<LL:
    print("AMBIGUOUS")
else:
    print("NA")


Fixed code:
s=input()
strdata=list(s)
data=list(map(int,strdata))
FF=10*data[0]+data[1]
LL=10*data[2]+data[3]
if FF==0 and 0<LL and LL<13:
    print("YYMM")
elif LL==0 and 0<FF and FF<13:
    print("MMYY")
elif 12<FF and LL<13 and 0<LL:
    print("YYMM")
elif 12<LL and FF<13 and 0<FF:
    print("MMYY")
elif FF<13 and LL<13 and 0<FF and 0<LL:
    print("AMBIGUOUS")
else:
    print("NA")
Buggy code:
S = input()
high = int(S[0:2])
low = int(S[2:4])

if 1<= high <= 12:
    if 1<= low <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
if high < 1 or high > 12:
    if 1<= low <= 12:
        print("YYMM")
    else:
        print("AMBIGUOUS")

Fixed code:
S = input()
high = int(S[0:2])
low = int(S[2:4])

if 1<= high <= 12:
    if 1<= low <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
if high < 1 or high > 12:
    if 1<= low <= 12:
        print("YYMM")
    else:
        print("NA")
Buggy code:


s = input()

a = int(s[0:2])
b = int(s[2:])

is_yymm = False
is_mmyy = False

if 1 <= b <= 12:
    is_yymm = True
if 1 <= a <= 12:
    is_mmyy = True

if is_yymm and is_mmyy:
    print("AMBIGUOUS")
elif is_yymm:
    print("YYMM")
else:
    print("MMYY")


Fixed code:


s = input()

a = int(s[0:2])
b = int(s[2:])

is_yymm = False
is_mmyy = False

if 1 <= b <= 12:
    is_yymm = True
if 1 <= a <= 12:
    is_mmyy = True

if is_yymm and is_mmyy:
    print("AMBIGUOUS")
elif is_yymm:
    print("YYMM")
elif is_mmyy:
    print("MMYY")
else:
    print("NA")
Buggy code:
from sys import stdin
s = stdin.readline().rstrip()
bef = s[:2]
aft = s[2:]

if bef == '00':
    if aft == '00':
        print('NA')
    elif int(aft) > 0 and int(aft) < 13:
        print('YYMM')
    else:
        print('NA')
elif int(bef) > 0 and int(bef) < 13:
    if aft == '00':
        print('MMYY')
    elif int(aft) > 0 and int(aft) < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if aft == '00':
        print('NA')
    elif int(aft) > 0 and int(aft) < 13:
        print('MMYY')
    else:
        print('NA')



Fixed code:
from sys import stdin
s = stdin.readline().rstrip()
bef = s[:2]
aft = s[2:]

if bef == '00':
    if aft == '00':
        print('NA')
    elif int(aft) > 0 and int(aft) < 13:
        print('YYMM')
    else:
        print('NA')
elif int(bef) > 0 and int(bef) < 13:
    if aft == '00':
        print('MMYY')
    elif int(aft) > 0 and int(aft) < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if aft == '00':
        print('NA')
    elif int(aft) > 0 and int(aft) < 13:
        print('YYMM')
    else:
        print('NA')
Buggy code:
def f(y, m):
	if y in range(1, 13) and m in range(1, 13):
      return "AMBIGUOUS"
    if m in range(1, 13):
      return "YYMM"
    if y in range(1, 13):
      return "MMYY"
    return "NA"
  
S = input()
y, m = int(S[:2]), int(S[2:])
print(f(y, m))
  

Fixed code:
def f(y, m):
	if y in range(1, 13) and m in range(1, 13):
		return "AMBIGUOUS"
	if m in range(1, 13):
		return "YYMM"
	if y in range(1, 13):
		return "MMYY"
	return "NA"
  
S = input()
y, m = int(S[:2]), int(S[2:])
print(f(y, m))
Buggy code:
s=str(input())
a="Y"
b="Y"
if 0<int(s[0:2])<13:
    print("#")
    a="MY"
if 0<int(s[2:5])<13:
    b="MY"

if a==b=="Y":
    ans="NA"
elif a=="Y" and b=="MY":
    ans="YYMM"
elif a=="MY" and b=="Y":
    ans="MMYY"
else:
    ans="AMBIGUOUS"
print(ans)

Fixed code:
s=str(input())
a="Y"
b="Y"
if 0<int(s[0:2])<13:
    a="MY"
if 0<int(s[2:5])<13:
    b="MY"

if a==b=="Y":
    ans="NA"
elif a=="Y" and b=="MY":
    ans="YYMM"
elif a=="MY" and b=="Y":
    ans="MMYY"
else:
    ans="AMBIGUOUS"
print(ans)
Buggy 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")
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")
Buggy code:
s=input()

l=int(s[:2])
r=int(s[2:4])

ans=""

if l<=12 and l>=1:
  if r<=12 and r>=1:
    ans="AMBIGUOUS"
  else:
    ans="MMYY"
if r<=12 and r>=1:
  if l<=12 and l>=1:
  	ans="AMBIGUOUS"
  else:
  	ans="YYMM"
if r>12 and r<1 and l>12 and l<1:
    ans="NA"
print(ans)

Fixed code:
s=input()

l=int(s[:2])
r=int(s[2:4])

ans=""

if l<=12 and l>=1:
  if r<=12 and r>=1:
    ans="AMBIGUOUS"
  else:
    ans="MMYY"
elif r<=12 and r>=1:
  ans="YYMM"
else:
  ans="NA"

print(ans)
Buggy code:
S = input()
s1,s2 = int(S[0:2]),int(S[2:4])

def f(n):
  if n >= 1 and n <= 12:
    return True
  else:
    return False

if f(s1) and f(s2):
  print("AMBIGUOUS")
elif f(s1) and s2 > 12 or s2 ==0:
  print("MMYY")
elif f(s2) and s1 > 12 or s1 ==0:
  print("YYMM")
else:
  print("NA")

Fixed code:
S = input()
s1,s2 = int(S[0:2]),int(S[2:4])

def f(n):
  if n >= 1 and n <= 12:
    return True
  else:
    return False

if f(s1) and f(s2):
  print("AMBIGUOUS")
elif f(s1) and (s2 > 12 or s2 ==0):
  print("MMYY")
elif f(s2) and (s1 > 12 or s1 ==0):
  print("YYMM")
else:
  print("NA")