qyliang/CodeNanoFix huggingface dataset:
Buggy code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''

def main():
    S = input()

    aa = int(S[:2])
    bb = int(S[2:])

    # print(aa,bb)
    if aa > 12 and bb > 12:
        print("NA")
    elif aa <= 12 and aa != 0 and bb <= 12 and bb != 0:
        print("AMBIGUOUS")
    elif aa <= 12 and aa != 0:
        print("MMYY")
    elif bb <= 12 and bb != 0:
        print("YYMM")


if __name__ == '__main__':
    main()

    

Fixed code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''

def main():
    S = input()

    aa = int(S[:2])
    bb = int(S[2:])

    # print(aa,bb)
    if (aa > 12 and bb > 12) or (aa == 0 and bb == 0):
        print("NA")
    elif aa >= 1 and aa <= 12 and bb >= 1 and bb <= 12:
        print("AMBIGUOUS")
    elif aa >= 1 and aa <= 12:
        print("MMYY")
    elif bb >= 1 and bb <= 12:
        print("YYMM")
    else:
        print("NA")


if __name__ == '__main__':
    main()
Buggy code:
S = list(input())
f1 = 1
f2 = 1
A = int(''.join(S[:2]))
B = int(''.join(S[2:]))
if A >= 13:
    f1 = 0
if B >= 13:
    f2 = 0
if f1 == 1 and f2 == 1:
    print('AMBIGUOUS')
elif f1 == 1 and f2 == 0:
    print('MMYY')
elif f1 == 0 and f2 == 1:
    print('YYMM')
else:
    print('NA')

Fixed code:
S = list(input())
f1 = 1
f2 = 1
A = int(''.join(S[:2]))
B = int(''.join(S[2:]))
if A >= 13 or A == 0:
    f1 = 0
if B >= 13 or B == 0:
    f2 = 0
if f1 == 1 and f2 == 1:
    print('AMBIGUOUS')
elif f1 == 1 and f2 == 0:
    print('MMYY')
elif f1 == 0 and f2 == 1:
    print('YYMM')
else:
    print('NA')
Buggy code:
N = list(input())
if 1 <= int(N[0]+N[1]) <=12 and 1 <= int(N[2]+N[3]) <= 12:
  print('AMBIGUOUS')
elif 1 <= int(N[0]+N[1]) <=12 and 12<int(N[2]+N[3])<1:
  print('MMYY')
elif 12<int(N[0]+N[1])<1 and 1 <= int(N[2]+N[3]) <=12:
  print('YYMM')
else:
  print('NA')


Fixed code:
N = list(input())
if 1 <= int(N[0]+N[1]) <=12 and 1 <= int(N[2]+N[3]) <=12:
  print('AMBIGUOUS')
elif 1 <= int(N[0]+N[1]) <=12:
  print('MMYY')
elif 1 <= int(N[2]+N[3]) <=12:
  print('YYMM')
else:
  print('NA')
Buggy code:
S = input()
first_half = int(S[:2])
second_half = int(S[2:])
if 0 < first_half and first_half <= 12 and 0 < second_half and second_half <= 12:
    print("ambiguous")
elif 0 < first_half and first_half <= 12:
    print("MMYY")
elif 0 < second_half and second_half <= 12:
    print("YYMM")
else:
    print("NA")

Fixed code:
S = input()
first_half = int(S[:2])
second_half = int(S[2:])
if 0 < first_half and first_half <= 12 and 0 < second_half and second_half <= 12:
    print("AMBIGUOUS")
elif 0 < first_half and first_half <= 12:
    print("MMYY")
elif 0 < second_half and second_half <= 12:
    print("YYMM")
else:
    print("NA")
Buggy code:
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and lst1[1] >=13):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<lst1[0] <=12:
      print("MMYY")
elif 0<lst1[1]<=12:
      print("YYMM")

Fixed code:
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and int(lst1[1]) >=13) or (lst1[0] =="00" and lst1[1] == "00"):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12:
      print("MMYY")
elif 0<int(lst1[1])<=12:
      print("YYMM")
Buggy code:
s=int(input())
k=s%100
l=(s-k)/100
k=int(k)
l=int(l)
if k<=12 and k>=1:
    if l>=1 and l<=12:
        ans='ANBIGUOUS'
    else:
        ans='YYMM'
elif l>=1 and l<=12:
    ans='MMYY'
else:
    ans='NA'
print(ans)
    
        


Fixed code:
s=int(input())
k=s%100
l=(s-k)/100
k=int(k)
l=int(l)
if k<=12 and k>=1:
    if l>=1 and l<=12:
        ans='AMBIGUOUS'
    else:
        ans='YYMM'
elif l>=1 and l<=12:
    ans='MMYY'
else:
    ans='NA'
print(ans)
Buggy code:
S=input()
a=int(S[:2])
b=int(S[2:])
if 1<=a<=12 and 1<=b<=12:
  print("AMBIGUOUS")
elif 1<=a<=12:
  print("MMYY")
elif 1<=B<=12:
  print("YYMM")
else:
  print("NA")


Fixed code:
S=input()
a=int(S[:2])
b=int(S[2:])
if 1<=a<=12 and 1<=b<=12:
  print("AMBIGUOUS")
elif 1<=a<=12:
  print("MMYY")
elif 1<=b<=12:
  print("YYMM")
else:
  print("NA")
Buggy code:
s = list(map(int,list(input()))
a = s[0]*10+s[1]
b = s[2]*10+s[3]
lst = [1,2,3,4,5,6,7,8,9,10,11,12]
if a in lst:
    if b in lst:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if b in lst:
        print('YYMM')
    else:
        print('NA')

Fixed code:
s = list(map(int,list(input())))
a = s[0]*10+s[1]
b = s[2]*10+s[3]
lst = [1,2,3,4,5,6,7,8,9,10,11,12]
if a in lst:
    if b in lst:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if b in lst:
        print('YYMM')
    else:
        print('NA')
Buggy code:
s=input()
a=int(s[:2])
b=int(s[2:])
if a>=13 and b>=1 and b<=12:
  print("YYMM")
elif a>=1 and a<=12 and (b==0 or b>=13):
  print("MMYY")
elif a>=1 and a<=12 b>=1 and b<=12:
  print("AMBIGUOUS")
else:
  print("NA")

Fixed code:
s=input()
a=int(s[0]+s[1])
b=int(s[2]+s[3])

if a>=13 and b>=1 and b<=12:
  print("YYMM")
elif a==0 and b>=1 and b<=12:
  print("YYMM")  
elif a>=1 and a<=12 and b>=13:
  print("MMYY")
elif a>=1 and a<=12 and b==0:
  print("MMYY")
elif a>=1 and a<=12 and b>=1 and b<=12:
  print("AMBIGUOUS")
else:
  print("NA")
Buggy code:
from itertools import accumulate
import sys
from heapq import heappush, heappop

def main():
    input = sys.stdin.readline
    S = input()
    a = int(S[:2])
    b = int(S[2:])
    if a > 12 and b <= 12:
        print('YYMM')
    elif a <= 12 and b > 12:
        print('MMYY')
    elif a <=12 and b <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')

if __name__ == '__main__':
    main()


Fixed code:
from itertools import accumulate
import sys
from heapq import heappush, heappop


def main():
    input = sys.stdin.readline
    S = input()
    a = int(S[:2])
    b = int(S[2:])
    if (a > 12 or a == 0) and 1 <= b <= 12:
        print('YYMM')
    elif 1 <= a <= 12 and (b > 12 or b == 0):
        print('MMYY')
    elif 1 <= a <= 12 and 1 <= b <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')


if __name__ == '__main__':
    main()
Buggy code:
A = input()
B =int(A[:1])
C =int(A[2:])

if B >=1 and B<=12:
    B_yy = True
else:
    B_yy = False

if C >=1 and C<=12:
    C_yy = True
else:
    C_yy = False

if B >=0 and B<=99:
    B_mm = True
else:
    B_mm = False

if C >=0 and C<=99:
    C_mm = True
else:
    C_mm = False

if B_yy == True and C_mm == True and B_mm ==True and C_yy ==True :
    print('AMBIGUOUS')
elif B_yy == True and C_mm == True:
    print('YYMM')
elif  C_yy == True and B_mm == True:
    print('YYMM')
else:
    print('NA')



Fixed code:


A = str(input())
B =int(A[:2])
C =int(A[2:4])


if B >=1 and B<=12:
    B_mm = True
else:
    B_mm = False

if C >=1 and C<=12:
    C_mm = True
else:
    C_mm = False

if B >=0 and B<=99:
    B_yy = True
else:
    B_yy = False

if C >=0 and C<=99:
    C_yy = True
else:
    C_yy = False

if B_yy == True and C_mm == True and B_mm ==True and C_yy ==True:
    print('AMBIGUOUS')
elif B_yy == True and C_mm == True:
    print('YYMM')
elif C_yy == True and B_mm == True:
    print('MMYY')
else:
    print('NA')
Buggy code:
S=input()
A=int(S[:2])
B=int(S[2:])
YM=MY=False
if 0<A and 0<B<=12:
    YM=True
elif 0<A<=12 and 0<B:
    MY=True

if MY and YM: print("AMBIGUOUS")
elif MY: print("MMYY")
elif YM: print("YYMM")
else: print("NA")


Fixed code:
S=input()
A=int(S[:2])
B=int(S[2:])

YM=MY=False
if 0<B<=12: YM=True
if 0<A<=12: MY=True

if MY and YM: print("AMBIGUOUS")
elif MY: print("MMYY")
elif YM: print("YYMM")
else: print("NA")
Buggy code:
S = input()
f = int(S[0]+S[1])
b = int(S[2]+S[3])

def judge(int):
    if 1 <= int <= 12
        return 0
    else:
        return 1
ref = [judge(f), judge(b)]

if ref == [1, 1]:
    print("NA")
elif ref == [0, 1]:
    print("MMYY")
elif ref == [1, 0]:
    print("YYMM")
else:
    print("AMBIGUOUS")


Fixed code:
S = input()
f = int(S[0]+S[1])
b = int(S[2]+S[3])

def judge(int):
    if 1 <= int <= 12:
        return 0
    else:
        return 1
ref = [judge(f), judge(b)]

if ref == [1, 1]:
    print("NA")
elif ref == [0, 1]:
    print("MMYY")
elif ref == [1, 0]:
    print("YYMM")
else:
    print("AMBIGUOUS")
Buggy code:
s = input()
u = int(s[0:2])
l = int(s[2:])
if u>12 and l <=12:
  print("YYMM")
elif u<=12 and l>12:
  print("MMYY")
elif u<=12 and l<=12:
  print("AMBIGUOUS")
else:
  print("NA")

Fixed code:
s = input()
u = int(s[0:2])
l = int(s[2:])
if u>12 and  0<l<=12:
  print("YYMM")
elif 0<u<=12 and l>12:
  print("MMYY")
elif 0<u<=12 and 0<l<=12:
  print("AMBIGUOUS")
elif u ==0 and 0<l<=12:
  print("YYMM")
elif 0<u<=12 and l ==0:
  print("MMYY")
else:
  print("NA")
Buggy code:
s = str(input())

if 0 < int(s[:2]) <= 12 and 0 < int(s[2:]) <= 12:
    ans = "AMBIGUOS"
elif 0 < int(s[:2]) <= 12:
    ans = "MMYY"
elif 0 < int(s[2:]) <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)


Fixed code:
s = str(input())
 
if 0 < int(s[:2]) <= 12 and 0 < int(s[2:]) <= 12:
    ans = "AMBIGUOUS"
elif 0 < int(s[:2]) <= 12:
    ans = "MMYY"
elif 0 < int(s[2:]) <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)
Buggy code:
s = str(input())

if 0 < int(s[:2]) <= 12:
    if 0 < int(s[2:]) <= 12:
        ans = "AMBIGUOS"
    else :
        ans = "MMYY"
elif 0 < int(s[:2]) <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)

Fixed code:
s = str(input())

if 0 < int(s[:2]) <= 12:
    if 0 < int(s[2:]) <= 12:
        ans = "AMBIGUOUS"
    else :
        ans = "MMYY"
elif 0 < int(s[2:]) <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)
Buggy code:
S = input()
a = int(S[:2])
b = int(S[2:])
left = 1 <= a <= 12
right = 1 <= a <= 12
if left and right:
    print("AMBIGUOUS")
elif left:
    print("MMYY")
elif right:
    print("YYMM")
else:
    print("NA")


Fixed code:
S = input()
a = int(S[:2])
b = int(S[2:])
left = 1 <= a <= 12
right = 1 <= b <= 12
if left and right:
    print("AMBIGUOUS")
elif left:
    print("MMYY")
elif right:
    print("YYMM")
else:
    print("NA")
Buggy code:
target = input()
first, second = int(target[0:2]), int(target[2:4])
if first = 0:
  first = 100
if second = 0:
  second = 100

def check():
  if first >12 and second >12:
    return 'NA'
  elif first <= 12 and second <= 12:
    return 'AMBIGUOUS'
  elif first >12 and second <= 12:
    return 'YYMM'
  else:
    return 'MMYY'

if __name__ == '__main__':
  print(check())

Fixed code:
target = input()
first, second = int(target[0:2]), int(target[2:4])
if first == 0:
  first = 100
if second == 0:
  second = 100

def check():
  if first >12 and second >12:
    return 'NA'
  elif first <= 12 and second <= 12:
    return 'AMBIGUOUS'
  elif first >12 and second <= 12:
    return 'YYMM'
  else:
    return 'MMYY'

if __name__ == '__main__':
  print(check())
Buggy code:
S = input()
pre, lat = int(S[0:2]), int(S[2:4])
pre_M = 1 <= pre <= 12
lat_M = 1 <= pre <= 12
if pre_M and lat_M:
  print("AMBIGUOUS")
elif pre_M:
  print("MMYY")
elif lat_M:
  print("YYMM")
else:
  print("NA")

Fixed code:
S = input()
pre, lat = int(S[0:2]), int(S[2:4])
pre_M = 1 <= pre <= 12
lat_M = 1 <= lat <= 12
if pre_M and lat_M:
  print("AMBIGUOUS")
elif pre_M:
  print("MMYY")
elif lat_M:
  print("YYMM")
else:
  print("NA")
Buggy code:
S = input()
first = int(S[:2])
last = int(S[2:])
print(first, last)

is_month_first = False
is_month_last = False

if first <= 12 and first > 0:
    is_month_first = True
if last <= 12 and last > 0:
    is_month_last = True

if is_month_first and is_month_last:
    print("AMBIGUOUS")
elif not is_month_first and not is_month_last:
    print("NA")
else:
    if is_month_first:
        print("MMYY")
    else:
        print("YYMM")

Fixed code:
S = input()
first = int(S[:2])
last = int(S[2:])

is_month_first = False
is_month_last = False

if first <= 12 and first > 0:
    is_month_first = True
if last <= 12 and last > 0:
    is_month_last = True

if is_month_first and is_month_last:
    print("AMBIGUOUS")
elif not is_month_first and not is_month_last:
    print("NA")
else:
    if is_month_first:
        print("MMYY")
    else:
        print("YYMM")
Buggy code:
	def main():
	    str = input()
	    YY = []
	    MM = []
	    YYMM_flg = False
	    MMYY_flg = False
	    AMB_flg = False
	    NA_flg = False

	    for i in range(2):
	    	YY.append(str[i])

	    for i in range(2, 4):
	    	MM.append(str[i])

	    yy = int(''.join(YY))
	    mm = int(''.join(MM))

	    if (yy >= 1 and yy <= 12) and (mm >= 1 and mm <= 12):
	    	AMB_flg = True
	    elif (mm >= 1 and mm <= 12) and (yy != 0 or mm != 0):
	    	YYMM_flg = True
	    elif (yy >= 1 and yy <= 12) and (yy != 0 or mm != 0):
	    	MMYY_flg = True
	    else:
	    	NA_flg = True

	    if AMB_flg:
	    	print("AMBIGUOUS")
	    elif YYMM_flg:
	    	print("YYMM")
	    elif MMYY_flg:
	    	print("MMYY")
	    elif NA_flg:
	    	print("NA")


	if __name__ == "__main__":
	    main()


Fixed code:
def main():
    str = input()
    YY = []
    MM = []
    YYMM_flg = False
    MMYY_flg = False
    AMB_flg = False
    NA_flg = False

    for i in range(2):
    	YY.append(str[i])

    for i in range(2, 4):
    	MM.append(str[i])

    yy = int(''.join(YY))
    mm = int(''.join(MM))

    if (yy >= 1 and yy <= 12) and (mm >= 1 and mm <= 12):
    	AMB_flg = True
    elif (mm >= 1 and mm <= 12) and (yy != 0 or mm != 0):
    	YYMM_flg = True
    elif (yy >= 1 and yy <= 12) and (yy != 0 or mm != 0):
    	MMYY_flg = True
    else:
    	NA_flg = True

    if AMB_flg:
    	print("AMBIGUOUS")
    elif YYMM_flg:
    	print("YYMM")
    elif MMYY_flg:
    	print("MMYY")
    elif NA_flg:
    	print("NA")


if __name__ == "__main__":
    main()
Buggy code:
a = input()
b=int(a[0:2])
c=int(a[2:4])
if 1<=b<=12 & 1<=c<=12:
    print('AMBIGUOUS')
elif 1<=b<=12 :
    print('MMYY') 
elif 1<=c<=12:
    print('YYMM')
else:
    print('NA')


Fixed code:
a = input()
b=int(a[0:2])
c=int(a[2:4])
if 1<=b<=12 and 1<=c<=12:
    print('AMBIGUOUS')
elif 1<=b<=12 :
    print('MMYY') 
elif 1<=c<=12:
    print('YYMM')
else:
    print('NA')
Buggy code:
def main():
    S = input()
    if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12:
        return "AMBIGUOUS"
    elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 12 >= int(S[2:]) > 0:
        return "YYMM"
    elif 0 < int(S[:2]) <= 12 and (12 < int(S[2:]) or int(S[2:]) == 0):
        return "MMYY"
    else:
        return "NA"


if __name__ == '__main__':
    main()


Fixed code:
def main():
    S = input()
    if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12:
        return "AMBIGUOUS"
    elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 12 >= int(S[2:]) > 0:
        return "YYMM"
    elif 0 < int(S[:2]) <= 12 and (12 < int(S[2:]) or int(S[2:]) == 0):
        return "MMYY"
    else:
        return "NA"


if __name__ == '__main__':
    print(main())
Buggy code:
s=input()
s1=int(s[:2])
s2=int(s[2:])
if 0<s1<13 and 0<s2<13:
  print("AMBIGUOUS")
if (12<s1 or s1=0) and 0<s2<13:
  print("YYMM")
if (12<s2 or s2=0) and 0<s1<13:
  print("MMYY")
else:
  print("NA")

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

s1 = S[0] + S[1]
s2 = S[2] + S[3]


if int(s1) > 12 and int(s2) > 12:
    print("NA")

elif int(s1) <= 12 and int(s2) > 12:
    print("MMYY")

elif int(s2) <= 12 and int(s1) > 12:
    print("YYMM")

else:
    print("AMBIGUOUS")

Fixed code:
S = input()

s1 = S[0] + S[1]
s2 = S[2] + S[3]


if (
    int(s1) > 12
    and int(s2) > 12
    or int(s1) == 0
    and int(s2) == 0
    or int(s1) == 0
    and int(s2) > 12
    or int(s1) > 12
    and int(s2) == 0
):
    print("NA")

elif 1 <= int(s1) <= 12 and (int(s2) > 12 or int(s2) == 0):
    print("MMYY")

elif 1 <= int(s2) <= 12 and (int(s1) > 12 or int(s1) == 0):
    print("YYMM")

else:
    print("AMBIGUOUS")
Buggy code:
s = list(input())
bef=int(s[0])*10+int(s[1])
aft=int(s[2])*10+int(s[3])

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

Fixed code:
s = list(input())
bef=int(s[0])*10+int(s[1])
aft=int(s[2])*10+int(s[3])

ans=''
if 0<aft<13 and 0<bef<13:
  ans='AMBIGUOUS'
elif (100>aft>12 or aft==0) and 0<bef<13:
  ans='MMYY'
elif (100>bef>12 or bef==0) and 0<aft<13:
  ans='YYMM'
else:
  ans='NA'
print(ans)
Buggy code:
s = list(input())

a = int(s[0]+s[1])
b = int(s[2]+s[3])

if  1<=a<=12 and 1<=b<=12:
  print('AMBIGUOUS')
elif a>12 and 1<=b<=12:
  print('YYMM')
elif b>12 and 1<=a<=12:
  print('MMYY')
elif a>12 and b>12:
  print('NA')
elof a<0 and b<0:
  print('NA')

Fixed code:
s = list(input())

a = int(s[0]+s[1])
b = int(s[2]+s[3])

if  1<=a<=12 and 1<=b<=12:
  print('AMBIGUOUS')
elif (a>12 or a==0) and 1<=b<=12:
  print('YYMM')
elif (b>12 or b==0) and 1<=a<=12:
  print('MMYY')
elif (a>12 or a==0) and (b>12 or b==0):
  print('NA')
Buggy code:
s=input()
word=list(s)
flaga=0
flagb=0
if (s[0]=='0' and 1<=int(s[1])<=9) or (s[0]=='1' and 0<=int(s[1])<=2):
  flaga+=1
if (s[2]=='0' and 1<=int(s[3])<=9) or (s[2]=='1' and 0<=int(s[3])<=2):
  flagb+=1

if flaga==1 and flagb==1:
  print('AMBIGUOUS')
elif flaga==1 and flagb==0:
  print('YYMM')
elif flaga==0 and flagb==1:
  print('MMYY')
elif flaga==0 and flagb==0:
  print('NA')
  

Fixed code:
s=input()
word=list(s)
flaga=0
flagb=0
if (s[0]=='0' and 1<=int(s[1])<=9) or (s[0]=='1' and 0<=int(s[1])<=2):
  flaga+=1
if (s[2]=='0' and 1<=int(s[3])<=9) or (s[2]=='1' and 0<=int(s[3])<=2):
  flagb+=1

if flaga==1 and flagb==1:
  print('AMBIGUOUS')
elif flaga==0 and flagb==1:
  print('YYMM')
elif flaga==1 and flagb==0:
  print('MMYY')
elif flaga==0 and flagb==0:
  print('NA')
Buggy code:
s = input()
ans = 'NA'
if 1 <= int(s[:2]) <= 12:
    ans = 'MMYY'
    if 1 <= int(s[2:]) <= 12:
        ans = 'ANBIGUOUS'
elif 1 <= int(s[2:]) <= 12:
    ans = 'YYMM'
print(ans)

Fixed code:
s = input()
ans = 'NA'
if 1 <= int(s[:2]) <= 12:
    ans = 'MMYY'
    if 1 <= int(s[2:]) <= 12:
        ans = 'AMBIGUOUS'
elif 1 <= int(s[2:]) <= 12:
    ans = 'YYMM'
print(ans)
Buggy code:
s = input()
a = int(s[:2])
b = int(s[2:])

if 0<a and a<13:
  if 0<b and b<13:
    print('AMBIGUOUS')
  elif b<0 or b>13:
    print('MMYY')
elif a<=0 or a>13:
  if 0<b and b<13:
    print('YYMM')
else:
    print('NA')

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

if (a > 12 or a == 0) and 0 < b <= 12:
  print("YYMM")
elif 0 < a <= 12 and (b > 12 or b == 0):
  print("MMYY")
elif 0 < a <= 12 and 0 < b <= 12:
  print("AMBIGUOUS")
else:
  print("NA")
Buggy code:
S = str(input())

S1 = S[0:2]
S2 = S[2:4]

if 1 <= int(S1) <= 12:
    if 1 <= int(S2) <= 12:
        print('AMBIGOUS')
        exit()
    else:
        print('MMYY')
        exit()

if 1 <= int(S2) <= 12:
    if 1 <= int(S1) <= 12:
        print('AMBIGOUS')
        exit()
    else:
        print('YYMM')
        exit()

print('NA')

Fixed code:
S = str(input())

S1 = S[0:2]
S2 = S[2:4]

if 1 <= int(S1) <= 12:
    if 1 <= int(S2) <= 12:
        print('AMBIGUOUS')
        exit()
    else:
        print('MMYY')
        exit()

if 1 <= int(S2) <= 12:
    if 1 <= int(S1) <= 12:
        print('AMBIGUOUS')
        exit()
    else:
        print('YYMM')
        exit()

print('NA')
Buggy code:
S = input()

if(int(S[:2])<=12 and int(S[2:])<=12):
    print("AMBIGUOUS")
elif(int(S[:2])<=12):
    print("MMYY")
elif(int(S[2:])<12):
    print("YYMM")
else:
    print("NA")


Fixed code:
S = input()

if(0<int(S[:2])<=12 and 0<int(S[2:])<=12):
    print("AMBIGUOUS")
elif(0<int(S[:2])<=12):
    print("MMYY")
elif(0<int(S[2:])<=12):
    print("YYMM")
else:
    print("NA")
Buggy code:
#ABC127B
S = input()
ab,cd = S[0:2],S[2:4]
if ab == "00" and cd == "00":
    print("NA")
elif int(ab) >= 13 and int(cd) >= 13:
    print("NA")
elif ab == "00" and int(cd) <= 12:
    print("YYMM")
elif int(ab) <= 12 and cd == "00":
    print("MMYY")
elif int(ab) <= 12 and int(cd) <= 12:
    print("AMBIGUOUS")
elif int(ab) <= 12 and int(cd) >= 13:
    print("MMYY")
elif int(ab) >= 13 and int(cd) <= 12:
    print("YYMM")

Fixed code:
#ABC127B
S = input()
ab,cd = S[0:2],S[2:4]
if ab == "00" and cd == "00":
    print("NA")
elif int(ab) >= 13 and int(cd) >= 13:
    print("NA")
elif ab == "00" and int(cd) >=13:
    print("NA")
elif int(ab) >=13 and cd =="00":
    print("NA")
elif ab == "00" and int(cd) <= 12:
    print("YYMM")
elif int(ab) <= 12 and cd == "00":
    print("MMYY")
elif int(ab) <= 12 and int(cd) <= 12:
    print("AMBIGUOUS")
elif int(ab) <= 12 and int(cd) >= 13:
    print("MMYY")
elif int(ab) >= 13 and int(cd) <= 12:
    print("YYMM")
Buggy code:
s = int(input())
a, b = s//100, s%100
boos = int(input())
a, b = s//100, s%100
p = bool(1 <= a <= 12)
q = bool(1 <= b <= 12)
if p & q:
    print("AMBIGUOUS")
elif p:
    print("MMYY")
elif q:
    print("YYMM")
else:
    print("NA")

Fixed code:
s = int(input())
a, b = s//100, s%100
p = bool(1 <= a <= 12)
q = bool(1 <= b <= 12)
if p & q:
    print("AMBIGUOUS")
elif p:
    print("MMYY")
elif q:
    print("YYMM")
else:
    print("NA")
Buggy code:
s = input();
first = s[0:2]
second = s[2:4]

first = int(first)
second = int(second)

if 0 < first and first < 13:
    if 0 < second and second < 13:
        print("AMBIGUOUS")
    elif (13 <= second):
        print("MMYY")
    else:
        print("YYMM")

elif 13 <= first:
    if 0 < second and second < 13:
        print("YYMM")
    elif (13 <= second):
        print("NA")
    else:
        print("YYMM")

else:
    if 0 < second and second < 13:
        print("YYMM")
    elif 13 <= second:
        print("NA")
    else:
        print("NA")

Fixed code:
s = input();
first = s[0:2]
second = s[2:4]

first = int(first)
second = int(second)

if 0 < first and first < 13:
    if 0 < second and second < 13:
        print("AMBIGUOUS")
    elif (13 <= second):
        print("MMYY")
    else:
        print("MMYY")

elif 13 <= first:
    if 0 < second and second < 13:
        print("YYMM")
    elif (13 <= second):
        print("NA")
    else:
        print("NA")

else:
    if 0 < second and second < 13:
        print("YYMM")
    elif 13 <= second:
        print("NA")
    else:
        print("NA")
Buggy code:
i=input()
l,m=map(int,[i[:2],i[2:]])
my=int(1<=l and l<=12)
ym=int(1<=m and m<=12)<<1
print(["NA","MMYY","YYMM","AMBIGUOUS"][my+ym]

Fixed code:
i=input()
l,m=map(int,[i[:2],i[2:]])
my=int(1<=l and l<=12)
ym=int(1<=m and m<=12)<<1
print(["NA","MMYY","YYMM","AMBIGUOUS"][my+ym])
Buggy code:
S = input()

S_mae = int(S[:2])
S_ushiro = int(S[2:])

flg_MMYY = 0
flg_YYMM = 0
if 0 <= S_mae and S_mae <= 12:
    flg_MMYY = 1
    if 0 <= S_ushiro and S_ushiro <= 12:
        flg_YYMM = 1
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif 0 <= S_ushiro and S_ushiro <= 12:
        flg_YYMM = 1
        print('YYMM')

else:
    print('NA')


Fixed code:
S = input()

S_mae = int(S[:2])
S_ushiro = int(S[2:])

flg_MMYY = 0
flg_YYMM = 0
if 1 <= S_mae and S_mae <= 12:
    flg_MMYY = 1
    if 1 <= S_ushiro and S_ushiro <= 12:
        flg_YYMM = 1
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif 1 <= S_ushiro and S_ushiro <= 12:
    flg_YYMM = 1
    print('YYMM')

else:
    print('NA')
Buggy code:
S = input()
SL = []
for i in range(1,13):
    SL.append("0"+str(i) if len(str(i)) == 1 else str(i))
 
 
if S[2:] in SL:
    if S[:2] in SL or S[:2] == "00":
        print("AMBIGOUS")
    else:
        print("YYMM")
    
else:
    if S[:2] in SL or SL[:2] == "00":
        print("MMYY")
    else:
        print("NA")

Fixed code:
S = input()
SL = []
for i in range(1,13):
    SL.append("0"+str(i) if len(str(i)) == 1 else str(i))
 
 
if S[2:] in SL:
    if S[:2] in SL:
        print("AMBIGUOUS")
    else:
        print("YYMM")
    
else:
    if S[:2] in SL or SL[:2] == "00":
        print("MMYY")
    else:
        print("NA")