qyliang/CodeNanoFix huggingface dataset:
Buggy code:
S = str(input())

front = int(S[:2])
back = int(S[2:4])

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

Fixed code:
S = str(input())

front = int(S[:2])
back = int(S[2:4])

if (front == 0 or front > 12) and back > 0 and back <= 12:
    print('YYMM')
elif front <= 12 and front > 0 and (back == 0 or back > 12):
    print('MMYY')
elif (front <= 12 and front > 0) and (back > 0 and back <= 12):
    print('AMBIGUOUS')
else:
    print('NA')
Buggy code:
# YYMM or MMYY or AMBIGUOUS or NA
s = input()

def year_chack(s):
    if not (s == "00"):
        return True
    else :
        return False

def manth_check(s):
    if ( s == '01' or
            s == '02' or
            s == '03' or
            s == '04' or
            s == '05' or
            s == '06' or
            s == '07' or
            s == '08' or
            s == '09' or
            s == '10' or
            s == '11' or
            s == '12'):
        return True
    else :
        return False

frond = s[0] + s[1]
back = s[2] + s[3]


status = ""

#YYMM
if (year_chack(frond) and manth_check(back)):
    status = status + "1"
else :
    status = status + "0"

#MMYY
if (manth_check(frond) and year_chack(back)):
    status = status + "1"
else :
    status = status + "0"

if (status == "11"):
    print("AMBIGUOUS")
elif (status == "00"):
    print("NA")
elif (status == "01"):
    print("MMYY")
elif (status == "10"):
    print("YYMMM")






Fixed code:
# YYMM or MMYY or AMBIGUOUS or NA
s = input()

def year_chack(s):
    return True

def manth_check(s):
    if ( s == '01' or
            s == '02' or
            s == '03' or
            s == '04' or
            s == '05' or
            s == '06' or
            s == '07' or
            s == '08' or
            s == '09' or
            s == '10' or
            s == '11' or
            s == '12'):
        return True
    else :
        return False

frond = s[0] + s[1]
back = s[2] + s[3]


status = ""

#YYMM
if (year_chack(frond) and manth_check(back)):
    status = status + "1"
else :
    status = status + "0"

#MMYY
if (manth_check(frond) and year_chack(back)):
    status = status + "1"
else :
    status = status + "0"

if (status == "11"):
    print("AMBIGUOUS")
elif (status == "00"):
    print("NA")
elif (status == "01"):
    print("MMYY")
elif (status == "10"):
    print("YYMM")
Buggy code:
S = input()

if 0 <= int(S[0:2]) <= 99 and 1 <= int(S[2:4]) <= 12:
    if (13 <= int(S[0:2]) or int(S[0:2]) == 0) <= 99 and 1 <= int(S[2:4]) <= 12:
        print("YYMM")
    elif 1 <= int(S[0:2]) <= 12 and 1 <= int(S[2:4]) <= 12:
        print("AMBIGUOUS")

elif 1 <= int(S[0:2]) <= 12 and 0 <= int(S[2:4]) <= 99:
    if 1 <= int(S[0:2]) <= 12 and (13 <= int(S[2:4]) <= 99 or int(S[2:4]) == 0):
        print("MMYY")
    elif 1 <= int(S[0:2]) <= 12 and 1 <= int(S[2:4]) <= 12:
        print("AMBIGUOUS")

else:
    print("NA")

Fixed code:
S = input()

if 0 <= int(S[0:2]) <= 99 and 1 <= int(S[2:4]) <= 12:
    if (13 <= int(S[0:2]) <= 99 or int(S[0:2]) == 0) and 1 <= int(S[2:4]) <= 12:
        print("YYMM")
    elif 1 <= int(S[0:2]) <= 12 and 1 <= int(S[2:4]) <= 12:
        print("AMBIGUOUS")

elif 1 <= int(S[0:2]) <= 12 and 0 <= int(S[2:4]) <= 99:
    if 1 <= int(S[0:2]) <= 12 and (13 <= int(S[2:4]) <= 99 or int(S[2:4]) == 0):
        print("MMYY")
    elif 1 <= int(S[0:2]) <= 12 and 1 <= int(S[2:4]) <= 12:
        print("AMBIGUOUS")

else:
    print("NA")
Buggy code:
from sys import stdin

s = stdin.readline().rstrip()

mae = s[:2]
ato = s[2:]

def syoukyo(i):
    if i[0] == 0:
        i = i[1]
    else:
        i = int(i)
    return int(i)

mae = syoukyo(mae)
ato = syoukyo(ato)

if mae > 12 and ato > 12:
    print("NA")
elif mae > 12 and ato < 13:
    print("YYMM")
elif mae < 13 and ato > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Fixed code:
from sys import stdin

s = stdin.readline().rstrip()

mae = s[:2]
ato = s[2:]

def syoukyo(i):
    if i[0] == 0:
        i = i[1]
    return int(i)

mae = syoukyo(mae)
ato = syoukyo(ato)

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

#MMYY
MMYY=1 if int(a)<=12 else 0
YYMM=1 if int(b)<=12 else 0

if MMYY==YYMM==1:
  print("AMBIGUOUS")
elif MMYY==1:
  print("MMYY")
elif YYMM==1:
  print("YYMM")
else:
  print("NA")

Fixed code:
s=input()
a=s[:2]
b=s[2:]
MMYY=0
YYMM=0

#MMYY
MMYY=1 if int(a)<=12 and int(a)>0 else 0
YYMM=1 if int(b)<=12 and int(b)>0 else 0

if MMYY==YYMM==1:
  print("AMBIGUOUS")
elif MMYY==1:
  print("MMYY")
elif YYMM==1:
  print("YYMM")
else:
  print("NA")
Buggy code:
A=input()
S=[int(A[i:i+2]) for i in range(0,len(A),2)]
if 0<=A[0] and A[0]<=12:
    if 0<=A[1] and A[1]<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 0<=A[1] and A[1]<=12:
        print('MMYY')
    else:
        print('NA')

Fixed code:
A=input()
S=[int(A[i:i+2]) for i in range(0,len(A),2)]
if 1<=S[0] and S[0]<=12:
    if 1<=S[1] and S[1]<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1<=S[1] and S[1]<=12:
        print('YYMM')
    else:
        print('NA')
Buggy code:
s=input()
if 10*int(s[2])+int(s[3])>=13:
  if int(s[0])+int(s[1])==0 or 10*int(s[0])+int(s[1])>=13:
    print("NA")
  else:
    print("MMYY")
if 10*int(s[0])+int(s[1])>=13:
  if int(s[2])+int(s[3])==0 or 10*int(s[2])+int(s[3])>=13:
    print("NA")
  else:
    print("YYMM")
if 10*int(s[2])+int(s[3])<=12 and 10*int(s[0])+int(s[1])<=12:
  print("AMBIGUOUS")
  else:
    print("NA")

Fixed code:
s=input()
if 10*int(s[0])+int(s[1])<=12 and int(s[0])+int(s[1])!=0:
  if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
    print("AMBIGUOUS")
  else:
    print("MMYY")
if 10*int(s[0])+int(s[1])>=13 or int(s[0])+int(s[1])==0:
  if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
    print("YYMM")
  else:
    print("NA")
Buggy code:
s = str (input())
bflag = True
lflag = True
if not(s[0] + s[1] in ['01','02','03','04','05','06','07','08','09','10','11','12']):
    bflag = False
if not(s[2] + s[3] in ['01','02','03','04','05','06','07','08','09','10','11','12']):
    lflag = False
if bflag:
    if lflag:
        print('ANBIGUOUS')
    else:
        print('MMYY')
else:
    if lflag:
        print('YYMM')
    else:
        print('NA')

Fixed code:
s = str (input())
bflag = True
lflag = True
if not(s[0] + s[1] in ['01','02','03','04','05','06','07','08','09','10','11','12']):
    bflag = False
if not(s[2] + s[3] in ['01','02','03','04','05','06','07','08','09','10','11','12']):
    lflag = False
if bflag:
    if lflag:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if lflag:
        print('YYMM')
    else:
        print('NA')
Buggy code:
import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *


if __name__ == '__main__':
    s = input()
    s1 = int(s[0:2])
    s2 = int(s[2:4])
    f1 = 0
    f2 = 0

    if s1 == 0:
        f1 = 0
    elif s1 >1 and 13 > s1:
        f1 = 1
    else:
        f2 =2

    if s2 == 0:
        f1 = 0
    elif s2 >1 and 13 > s2:
        f1 = 1
    else:
        f2 =2

    if f1 == 0 and f2 ==0:
        print("NA")
    elif (f1 ==0 and f2 == 2) or (f1 == 1 and f2 ==0) or (f1 == 2 and f2 ==2) :
        print("NA")
    elif (f1 ==0 and f2 == 1) or (f1 == 2 and f2 ==1) :
        print("MMYY")

    elif (f1 ==1 and f2 == 0) or (f1 == 1 and f2 ==2) :
        print("YYMM")

    else:
        print("AMBIGUOUS")









Fixed code:
import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *


if __name__ == '__main__':
    s = input()
    s1 = int(s[0:2])
    s2 = int(s[2:4])
    f1 = 0
    f2 = 0

    if s1 == 0:
        f1 = 0
    elif s1 >0 and 13 > s1:
        f1 = 1
    else:
        f1 =2

    if s2 == 0:
        f2 = 0
    elif s2 >0 and 13 > s2:
        f2 = 1
    else:
        f2 =2

    if f1 == 0 and f2 ==0:
        print("NA")
    elif (f1 ==0 and f2 == 2) or (f1 == 2 and f2 ==2) or (f1 == 2 and f2 ==0) :
        print("NA")
    elif (f1 ==0 and f2 == 1) or (f1 == 2 and f2 ==1) :
        print("YYMM")
    elif (f1 ==1 and f2 == 0) or (f1 == 1 and f2 ==2) :
        print("MMYY")
    else:
        print("AMBIGUOUS")
Buggy code:
S = list(input())

s_1 = int(S[0:1])
s_2 = int(S[2:])

YYMM = False
MMYY = False

if 1<=s_2<=12:
    YYMM = True
if 1<=s_1<=12:
    MMYY = True
    
if YYMM and MMYY:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')
else:
    print('NA')

Fixed code:
S = input()

s_1 = int(S[0:2])
s_2 = int(S[2:])

YYMM = False
MMYY = False

if 1<=s_2<=12:
    YYMM = True
if 1<=s_1<=12:
    MMYY = True
    
if YYMM and MMYY:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')
else:
    print('NA')
Buggy code:
s=input()
s1=int(s[:2])
s2=int(s[2:])

if s1<=12 & s1>=1:
  if s2<=12 & s2>=1:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if s2<=12 & s2>=1:
    print('YYMM')
  else:
    print('NA')

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

if (s1<=12) & (s1>=1):
  if (s2<=12) & (s2>=1):
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if (s2<=12) & (s2>=1):
    print('YYMM')
  else:
    print('NA')
Buggy code:
s = input()
aa = int(s[:2])
bb = int(s[2:])

if 0<aa and aa<=12:
  if 0<bb and bb<=12:
    print('AMBIGUOUS')
  elif bb==0:
    print('NA')
  else:
    print('MMYY')
elif aa!=0:
  0<bb and bb<=12:
  print('YYMM')
else:
  print('NA')


Fixed code:
s = input()
aa = int(s[:2])
bb = int(s[2:])

if 0<aa and aa<=12:
  if 0<bb and bb<=12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if 0<bb and bb<=12:
    print('YYMM')
  else:
    print('NA')
Buggy code:
s = input()

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

Fixed code:
s = input()

if 0 < int(s[0:2]) <= 12 and 0 < int(s[2:4]) <= 12 :
  print("AMBIGUOUS")
elif (12 < int(s[0:2]) or int(s[0:2]) == 0) and  0 < int(s[2:4]) <= 12:
  print("YYMM")
elif 0 < int(s[0:2]) <= 12 and (12 < int(s[2:4]) or int(s[2:4]) == 0):
  print("MMYY")
else:
  print("NA")
Buggy code:
def checkMM(i):
    if i >= 1 and i <= 12:
        result = 1
    else:
        result = 0
    return result

def checkYY(i):
    if i >= 0 and i <= 99:
        result = 1
    else:
        result = 0
    return result


s = input()

s1 = int(s[:3])
s2 = int(s[3:])

result = 'NA'

if checkMM(s1) and checkYY(s2):
    result = 'MMYY'

if checkYY(s1) and checkMM(s2):
    if result == 'MMYY':
        result = 'AMBIGUOUS'
    else:
        result = 'YYMM'

print(result)

Fixed code:
def checkMM(i):
    if i >= 1 and i <= 12:
        result = 1
    else:
        result = 0
    return result

def checkYY(i):
    if i >= 0 and i <= 99:
        result = 1
    else:
        result = 0
    return result


s = input()

s1 = int(s[:2])
s2 = int(s[2:])

result = 'NA'

if checkMM(s1) and checkYY(s2):
    result = 'MMYY'


if checkYY(s1) and checkMM(s2):
    if result == 'MMYY':
        result = 'AMBIGUOUS'
    else:
        result = 'YYMM'

print(result)
Buggy code:
s = input()

s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
print(s1, s2)
L=[]

for i in range(1, 13):
    L.append(i)


if s1 not in L and s2 not in L:
    print('NA')
elif s1 in L and s2 not in L:
    print('MMYY')
elif s1 not in L and s2 in L:
    print('YYMM')
else:
    print('AMBIGUOUS')


Fixed code:
s = input()

s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
#print(s1, s2)
L=[]

for i in range(1, 13):
    L.append(i)


if s1 not in L and s2 not in L:
    print('NA')
elif s1 in L and s2 not in L:
    print('MMYY')
elif s1 not in L and s2 in L:
    print('YYMM')
else:
    print('AMBIGUOUS')
Buggy code:
s=input()
if int(s[:2])<=12 and int(s[:2])>0:
    if int(s[2:4])<=12 and int(s[2:4])>0:
        print("AMIGUOUS")
    else:
        print("MMYY")
elif int(s[2:4])<=12 and int(s[2:4])>0:
    print("YYMM")
else:
    print("NA")

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

Fixed code:
S = input()
f = int(S[:2])
s = int(S[2:])
if 1 <= f <= 12:
  if 1 <= s <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
elif 1 <= s <= 12:
  print('YYMM')
else:
  print('NA')
Buggy code:
YM=0
MY=0
F=int(X[0] + X[1])
B=int(X[2] + X[3])
if 0<F<=12 :
    MY += 1
else:
    pass

if 0<B<=12 :
    YM += 1
else:
    pass

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

Fixed code:
X=input()
YM=0
MY=0
F=int(X[0] + X[1])
B=int(X[2] + X[3])
if 0<F<=12 :
    MY += 1
else:
    pass

if 0<B<=12 :
    YM += 1
else:
    pass

if YM == 1 and MY == 1 :
    print("AMBIGUOUS")
elif YM == 1 and MY == 0 :
    print("YYMM")
elif YM == 0 and MY == 1 :
    print("MMYY")
else :
    print("NA")
Buggy code:
a = int(input())
b = str(a)
over = int(b[:2])
under = int(b[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
else if 0<over<13 and (1>under or under>12):
   print("YYMM")
else if(0<under<13 and (1>over or over>12):
   print("MMYY")
else:
   print("NA")

Fixed code:
a = input()
over = int(a[:2])
under = int(a[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
elif 0<over<13 and (1>under or under>12):
     print("MMYY")
elif 0<under<13 and (1>over or over>12):
     print("YYMM")
else:
     print("NA")
Buggy code:
s = input()
if (s[0] == '0' or (s[0] == '1' and int(s[1]) <= 2)) and (s[2] == '0' or (s[2] == '1' and int(s[3]) <= 2)):
  print('AMBIGUOUS')
elif s[0] == '0' or (s[0] == '1' and int(s[1]) <= 2):
  print('MMYY')
elif s[2] == '0' or (s[2] == '1' and int(s[3]) <= 2):
  print('YYMM')
else:
  print('NA')

Fixed code:
s = input()
if ((s[0] == '0' and s[1] != '0') or (s[0] == '1' and int(s[1]) <= 2)) and ((s[2] == '0' and s[3] != '0') or (s[2] == '1' and int(s[3]) <= 2)):
  print('AMBIGUOUS')
elif (s[0] == '0' and s[1] != '0') or (s[0] == '1' and int(s[1]) <= 2):
  print('MMYY')
elif (s[2] == '0' and s[3] != '0') or (s[2] == '1' and int(s[3]) <= 2):
  print('YYMM')
else:
  print('NA')
Buggy code:
S = input()
first = int(S[:2])
second = int(S[2:])
if((first>12 or first==0) and (second>12 or second==0)):
    print("NA")
elif(first<=12 and (second>12 or second==0)):
    print("MMYY")
elif(second<=12 and (first>12 or first==0)):
    print("YYMM")
else:
    print("AMBIGIOUS")

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

a, b = int(s[:2]), int(s[2:])
if 0 < a < 13 and 0 < b < 13:
    print('AMBIGOUS')
elif 0 < a < 13:
    print('MMYY')
elif 0 < b < 13:
    print('YYMM')
else:
    print("NA")


Fixed code:
s = input()

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


Fixed code:
S = input()
if 1 <= int(S[0:2]) <= 12:
    if 1 <= int(S[2:]) <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1 <= int(S[2:]) <= 12:
        print("YYMM")
    else:
        print("NA")
Buggy code:
a = list(input())
for i in range(len(a)):
    a[i] = int(a[i])
ue = a[0]*10 + a[1]
sita = a[2]*10 + a[3]
if (ue >= 12) & (sita >= 12):
    print('NA')
elif (ue <= 12) & (sita <= 12):
    print('AMBIGUOUS')
elif ue >= 12:
    if sita <= 12:
        print('YYMM')
    else:
        print('MMYY')

Fixed code:
a = list(input()) 
for i in range(len(a)):
    a[i] = int(a[i])
ue = a[0]*10 + a[1]
sita = a[2]*10 + a[3]
if (ue > 12) & (sita > 12):
    print('NA')
elif (ue <= 12) & (sita <= 12):
    if (sita + ue) == 0:
        print('NA')
    elif (ue == 0):
        print('YYMM')
    elif (sita == 0):
        print('MMYY')
    else:
        print('AMBIGUOUS')
elif ue > 12:
    if (sita <= 12) & (sita > 0):
        print('YYMM')
    else:
        print('NA')
elif sita > 12:
    if (ue <= 12) & (ue > 0):
        print('MMYY')
    else:
        print('NA')
Buggy code:
def check(M_1, M_2):
    M_1 = int(M_1)
    M_2 = int(M_2)
    MM = M_1 * 10 + M_2
    if 1 <= MM <= 12:
        return True
    else:
        return False


S = input()
ans = [0, 0]
if check(S[0], S[1]):
    ans[0] += 1
if check(S[2], S[3]):
    ans[1] += 1

if ans == [0, 0]:
    print("NA")
elif ans == [0, 1]:
    print("YYMM")
elif ans == [1, 0]:
    print("MMYY")
elif ans == [1, 1]:
    print("AMBIGIOUS")


Fixed code:
def check(M_1, M_2):
    M_1 = int(M_1)
    M_2 = int(M_2)
    MM = M_1 * 10 + M_2
    if 1 <= MM <= 12:
        return True
    else:
        return False


S = input()
ans = [0, 0]
if check(S[0], S[1]):
    ans[0] += 1
if check(S[2], S[3]):
    ans[1] += 1

if ans == [0, 0]:
    print("NA")
elif ans == [0, 1]:
    print("YYMM")
elif ans == [1, 0]:
    print("MMYY")
elif ans == [1, 1]:
    print("AMBIGUOUS")
Buggy code:
s = input()
mmyy = (1 <= int(s[0:2]) <= 12)
yymm = (1 <= int(s[2:-1]) <= 12)
if mmyy:
  if yymm:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if yymm:
    print('YYMM')
  else:
    print('NA')

Fixed code:
s = input()
mmyy = (1 <= int(s[:2]) <= 12)
yymm = (1 <= int(s[2:]) <= 12)
if mmyy:
  if yymm:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if yymm:
    print('YYMM')
  else:
    print('NA')
Buggy code:
YYMM = False
MMYY = False
f = input()
h1 = f[0] + f[1]
h2 = f[2] + f[3]

if 1 <= h2 <= 12:
  YYMM = True
if 1 <= h1 <= 12:
  MMYY = True

def ret(c1,c2):
  if c1 and c2:
    return "AMBIGUOUS"
  elif c1:
    return "YYMM"
  elif c2:
    return "MMYY"
  else:
    return "NA"
  
print(ret(YYMM,MMYY))

Fixed code:
YYMM = False
MMYY = False
f = input()
h1 = f[0] + f[1]
h2 = f[2] + f[3]

if 1 <= int(h2) <= 12:
  YYMM = True
if 1 <= int(h1) <= 12:
  MMYY = True

def ret(c1,c2):
  if c1 and c2:
    return "AMBIGUOUS"
  elif c1:
    return "YYMM"
  elif c2:
    return "MMYY"
  else:
    return "NA"
  
print(ret(YYMM,MMYY))
Buggy code:
s=list(input())
u=[int(s[0]+s[1]),int(s[2]+s[3])]
if(u[0]<=12):
    m1=1
    if(u[1]<=12):
        m2=1
    else:
        m2=0
else:
    m1=0
    if(u[1]<=12):                                                                                                                           m2=1                                                                                                                            else:
        m2=0
if(m1==1 and m2==0):
    print('MMYY')                                                                                                                   elif(m1==1 and m2==1):
    print('AMBIGUOUS')
elif(m1==0 and m2==0):
    print('NA')
else:
    print('YYMM')

Fixed code:
s=list(input())
u=[int(s[0]+s[1]),int(s[2]+s[3])]
if(0<u[0]<=12):
    m1=1
    if(0<u[1]<=12):                                                                                                                                                                                                    m2=1
    else:
        m2=0
else:
    m1=0
    if(0<u[1]<=12):
        m2=1
    else:
        m2=0
if(m1==1 and m2==0):
    print('MMYY')
elif(m1==1 and m2==1):
    print('AMBIGUOUS')
elif(m1==0 and m2==0):
    print('NA')
else:
    print('YYMM')
Buggy code:
s = input()
ans = "NA"
c = 0
#YYMM
if 0<=int(s[:2])<=99 and 1<=int(s[2:])<=12:
  ans = "YYMM"
  c += 1
#MMYY
elif 1<=int(s[:2])<=12 and 0<=int(s[2:])<=99:
  ans = "MMYY"
if c == 2:
  ans = "AMBIGUOUS"
print(ans)

Fixed code:
s = input()
ans = "NA"
c = 0
#YYMM
if 0<=int(s[:2])<=99 and 1<=int(s[2:])<=12:
  ans = "YYMM"
  c += 1
#MMYY
if 1<=int(s[:2])<=12 and 0<=int(s[2:])<=99:
  ans = "MMYY"
  c+=1
if c == 2:
  ans = "AMBIGUOUS"
print(ans)
Buggy code:
S = input()

ans1 = 'YYMM'
ans2 = 'MMYY'
ans3 = 'AMBIGUOUS'
ans4 = 'NA'

s1 = int(S[:2])
s2 = int(S[2:])

if 1 < s1 < 13 and 1 < s2 < 13:
  print(ans3) 
elif 0 < s1 < 13:
  print(ans2) 
elif 0 < s2 < 13:
  print(ans1) 
else:
  print(ans4)

Fixed code:
S = input()

ans1 = 'YYMM'
ans2 = 'MMYY'
ans3 = 'AMBIGUOUS'
ans4 = 'NA'

s1 = int(S[:2])
s2 = int(S[2:])

if 0 < s1 < 13 and 0 < s2 < 13:
  print(ans3) 
elif 0 < s1 < 13:
  print(ans2) 
elif 0 < s2 < 13:
  print(ans1) 
else:
  print(ans4)
Buggy code:
s = input()
ans = ""
a = int(s[0]+s[1])
b = int(s[2]+s[3])

if a == 0 and b == 0:
    ans = "NA"
elif a > 12 and b == 0:
    ans = "NA"
elif a == 0 and b > 12:
    ans = "NA"
elif a > 12 and b > 12:
    ans = "NA"
elif a < 13 and b < 13 and a != 0 and b != 0:
    ans = "AMBIGUOUS"
else:
    ans = s[2]+s[3]+s[0]+s[1]

print(ans)


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

if a == 0 and b == 0:
    ans = "NA"
elif a > 12 and b == 0:
    ans = "NA"
elif a == 0 and b > 12:
    ans = "NA"
elif a > 12 and b > 12:
    ans = "NA"
elif a > 12 and b < 13 and b != 0:
    ans = "YYMM"
elif a < 13 and b > 12 and a != 0:
    ans = "MMYY"
elif a == 0 and b < 13:
    ans = "YYMM"
elif a < 13 and b == 0:
    ans = "MMYY"
else:
    ans = "AMBIGUOUS"

print(ans)
Buggy code:
n =  input()
f = n[:2]
a = n[2:]
#print(f,a)
month = ['01','02','03','04','05','06','07','08','09','10','11','12']
#print(type(f))
if   (f in month) & (a in month):
  print('AMBIGUOUS')
elif (f in month):
  print('MMYY')
else:
#  a in month:
  print('YYMM')

Fixed code:
n =  input()
f = n[:2]
a = n[2:]
#print(f,a)
month = ['01','02','03','04','05','06','07','08','09','10','11','12']
#print(type(f))
if   (f in month) & (a in month):
  print('AMBIGUOUS')
elif (f in month):
  print('MMYY')
elif (a in month):
#  a in month:
  print('YYMM')
else:
  print('NA')
Buggy code:
s = input()
am = s[0]+s[1]
pm = s[2]+s[3]
p = ["01","02","03","04","05","06","07","08","09","10","11","12"]
if am in p and pm in p:
    print("AMBIGUOUGS")
elif am in p and pm not in p:
    print("MMYY")
elif am not in p and pm in p:
    print("YYMM")
elif am not in p and pm not in p:
    print("NA")

Fixed code:
s = input()
am = s[0]+s[1]
pm = s[2]+s[3]
p = ["01","02","03","04","05","06","07","08","09","10","11","12"]
if am in p and pm in p:
    print("AMBIGUOUS")
elif am in p and pm not in p:
    print("MMYY")
elif am not in p and pm in p:
    print("YYMM")
elif am not in p and pm not in p:
    print("NA")
Buggy code:
S = input()
ot = S[:2]
tf = S[2:]

isotMM = 0
istfMM = 0

if 0 < int(ot) and int(ot) < 13:
    isotMM = 1
if 0 < int(tf) and int(tf) < 13:
    istfMM = 1
    
if isotMM == 1:
    if istfMM == 1:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if istfMM == 1:
        print('YYMM')
    else:
        print(NA)

Fixed code:
S = input()
ot = S[:2]
tf = S[2:]

isotMM = 0
istfMM = 0

if 0 < int(ot) and int(ot) < 13:
    isotMM = 1
if 0 < int(tf) and int(tf) < 13:
    istfMM = 1
    
if isotMM == 1:
    if istfMM == 1:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if istfMM == 1:
        print('YYMM')
    else:
        print("NA")