Problem:


Score : 200 points

Problem Statement

You have a digit sequence S of length 4. You are wondering which of the following formats S is in:

YYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order

MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order

If S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.

Constraints

S is a digit sequence of length 4.

Input

Input is given from Standard Input in the following format:

S

Output

Print the specified string: YYMM, MMYY, AMBIGUOUS or NA.

Sample Input 1

1905

Sample Output 1

YYMM

May XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.

Sample Input 2

0112

Sample Output 2

AMBIGUOUS

Both December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.

Sample Input 3

1700

Sample Output 3

NA

Neither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.



Sample input:
1905


Sample output:
YYMM

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0] + s[1])
b = int(s[2] + s[3])
if a>=13 and b >=13:
    print('NA')
elif a >= 13:
    print('YYMM')
elif b >= 13:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0] + s[1])
b = int(s[2] + s[3])
if a >= 13:
    print('YYMM')
elif b >= 13:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S=list(input())
f=10*int(S[0])+ int(S[1])
l=10*int(S[2])+int(S[3])
if 1<=f<=12 and 1<=l<=12:
  print('AMBIGUOUS')
elif f>=13 and 1<=l<=12:
  print('YYMM')
elif 1<=f<=12 and l>=13:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S=list(input())
f=10*int(S[0])+ int(S[1])
l=10*int(S[2])+int(S[3])
if 1<=f<=12 and 1<=l<=12:
  print('AMBIGUPUS')
elif f>=13 and 1<=l<=12:
  print('YYMM')
elif 1<=f<=12 and l>=13:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0:2]
b = s[2:]

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

a = to_int(a)
b = to_int(b)

if a > 12 and 1 <= b <= 12:
    print("YYMM")
elif 1 <= a <= 12 and b > 12:
    print("MMYY")
elif 1 <= a <= 12 and 1 <= b <= 12:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
a=int(input())

u = int(a /100)
l = a%100

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

Submission status: Wrong Answer

Solution code:
num = input()
num_1 = int(num[0:2])
num_2 = int(num[2:4])

if num_1==0 and num_2>=13 or num_1>=13 and num_2==0 or num_1>=13 and num_2>=13:
  print('NA')

elif num_1>=13 or num_2>=13:
  print('YYMM')
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
first = int(s[:2])
second = int(s[2:])

if(first > 12 and second <= 12 and second != 0):
	print("YYMM")
elif(first <= 12 and second > 12):
	print("MMYY")
elif(first <= 12 and second <= 12 and second != 0):
	print("AMBIGUOUS")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
first = int(s[:2])
second = int(s[2:])

if(first > 12 and second <= 12 and second != 0):
	print("YYMM")
elif(first <= 12 and second > 12 and first != 0):
	print("MMYY")
elif(first <= 12 and second <= 12 and first != 0 and second != 0):
	print("AMBIGUOUS")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
first = int(s[:2])
second = int(s[2:])

if(first > 12 and second <= 12):
	print("YYMM")
elif(first <= 12 and second > 12):
	print("MMYY")
elif(first <= 12 and second <= 12):
	print("AMBIGUOUS")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
s = list(input())
if int(s[0]+s[1]) > 12:
    if int(s[2]+s[3]) > 12 or int(s[2]+s[3]) == 0: print('NA')
    else: print('YYMM')
else:
    if int(s[2]+s[3]) > 12:
        if int(s[0]+s[1]) == 0: print('NA')
        else: print('MMYY')
    else: print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = s[0:2]
s2 = s[2:]
m = ["01","02","03","04","05","06","07","08","09","10","11","12"]
x = [str(i) for i in range(13,100)]
if (s1 in m and s2 in m) :
    print("AMBIGUOUS")
elif (s1 in x and s2 in x) or ("00" in s1 or "00" in s2 ):
    print("NA")
if s1 in m and s2 in x:
    print("MMYY")
elif s1 in x and s2 in m:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = s[0:2]
s2 = s[2:]
m = ["01","02","03","04","05","06","07","08","09","10","11","12"]
x = [str(i) for i in range(13,100)]
if (s1 in m and s2 in m) :
    print("AMBIGUOUS")
elif (s1 in x and s2 in x) or ("00" is s1 or "00" in s2 ):
    print("NA")
if s1 in m and s2 in x:
    print("MMYY")
elif s1 in x and s2 in m:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = s[0:2]
s2 = s[2:]
m = ["01","02","03","04","05","06","07","08","09","10","11","12"]
x = [str(i) for i in range(13,100)]
y = m + x
if s1 in m and s2 in m:
    print("AMBIGUOUS")
    exit()
if s1 == "00" or s2 == "00":
    print("NA")
    exit()
if s1 in x and s2 in x:
    print("NA")
    exit()
if s1 in m and s2 in x:
    print("MMYY")
elif s1 in x and s2 in m:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = s[0:2]
s2 = s[2:]
m = ["01","02","03","04","05","06","07","08","09","10","11","12"]
x = [str(i) for i in range(13,100)]
y = m + x
if s1 in m and s2 in m:
    print("AMBIGUOUS")
    exit()
if s1 == "00" or s2 == "00":
    print("NA")
    exit()
if s1 in x and s2 in x:
    print("NA")
    exit()
if s1 in m and s2 in y:
    print("MMYY")
elif s1 in y and s2 in m:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
f = int(s[0:2])
l = int(s[2:4])

state = {"yymm": False, "mmyy": False}

if 0<= f <= 99:
    if 1<= l <= 12:
        state["yymm"] = True

if 0<= l <= 99:
    if 1<= f <= 12:
        state["mmyy"] = True

if state["yymm"] == True and state["mmyy"] == True:
    print("AMBIGUOUS")
elif state["yymm"] == True and state["mmyy"] == False:
    print("yymm")
elif state["yymm"] == False and state["mmyy"] == True:
    print("mmyy")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
N = list(input())
m = list(map(int,N))
a = 10*m[0] + m[1]
b = 10*m[2] + m[3]

if 1<=a<=12 and 1<=b<=12:
  print("AMBIGUOUS")
elif 1<=a<=12:
  print("MMYY")
elif 1<=b<=12:
  print("YYMM")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
S = input()
first = int(S[0:2])
second = int(S[2:])

if first == 0 or second == 0:
    print("NA")
elif first > 12 and second > 12:
    print("NA")
elif first > 12:
    print("YYMM")
elif second > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
x=int(input())

y=x//100
m=x-y*100

if y>0 and y<13:
	if m>0 and m<13:
		res='AMBIGUOUS'
	else:
		res='MMYY'
else:
	if m>0 and m<12:
		res='YYMM'
	else:
		res='NA'

print(res)

Submission status: Wrong Answer

Solution code:
s=input()
sf=int(s[:2])
sl=int(s[2:])
#print(int(sf)+int(sl))
if 1<= sf <=12 and 1<=sl <=12:
  print("AMBIGUOUS")
elif 1<= sf <=12 and 12<sl:
  print("MMYY")
elif 1<= sl <=12 and 12<sf:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S=int(input())
a=S//100
b=S%100
if a==0 or a>13:
  if b==0 or b>13:
    print("NA")
  else:
    print("YYMM")
else:
  if b==0 or b>13:
    print("MMYY")
  else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[0:2])
s2=int(s[2:4])

if 0<s1<13 and 0<s2<13:
    print("AMBIGUOUS")
elif 0<s1<13:
    print("MMYY")
elif 0<s2<13:
    print("YYMM")
else:
    print("NA")

print(s1,s2)

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[0:2])
s2=int(s[3:4])

if 0<s1<13 and 0<s2<13:
    print("AMBIGUOUS")
elif 0<s1<13:
    print("MMYY")
elif 0<s2<13:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
h = int(s[:2])
l = int(s[3:])

def mmok(i):
  return 1 <= i <= 12

if mmok(h):
  if mmok(l):
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if mmok(l):
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

Solution code:
a=int(input())
f=a//100
b=a%100
if 1<=f<=12 and 1<=b<=12:
    print("AMBIGUOUS")
elif 1<=f<=12 and 12<b:
    print("MMYY")
elif 1<=b<=12 and 12<f:
    print("YYMM")
else:print("NA")

Submission status: Wrong Answer

Solution code:
a=int(input())
f=a//100
b=a%100
if (f==0 or b==0) or (f>12 and b>12):
    print("NA")
elif 1<=f<=12 and 1<=b<=12:
    print("AMBIGUOUS")
elif 1<=f<=12 and 12<b:
    print("MMYY")
else:print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
if int(s[:2]) > 0 and int(s[:2]) < 13 and (int(s[2:]) > 13 or int(s[2:]) == 0):
    print("MMYY")
elif int(s[2:]) > 0 and int(s[2:]) < 13 and (int(s[:2]) > 13 or int(s[:2]) == 0):
    print("YYMM")
elif int(s[:2]) > 0 and int(s[:2]) < 13 and int(s[2:]) > 0 and int(s[2:]) < 13:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
first = int(s[:2])
second = int(s[2:])

def judge_1_12(n):
    if n > 0 and n < 13:
        return True
    else:
        return False

if judge_1_12(first) or judge_1_12(second):
    if judge_1_12(first) and judge_1_12(second):
        print("AMBIGUOUS")
    elif first > 12:
        print("YYMM")
    else:
        print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution 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")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0:2])
b = int(s[2:4])
if (a == 0 & b == 0)|(a>12 & b>12):
   print("NA")
elif(a <= 12 & b <= 12):
  print("AMBIGUOUS")
elif(a <= 12 & b > 12):
  print("MMYY")
else:
  print("YYMM");

Submission status: Wrong Answer

Solution code:
def judge_month(s):
    if '00' < s and s <= '12':
        return True
    else:
        return False

S = input()

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

month_1 = judge_month(s1)
month_2 = judge_month(s2)

if s1 and s2:
    print('AMBIGUOUS')
elif month_1:
    print('MMYY')
elif month_2:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution 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")

Submission status: Wrong Answer

Solution code:
a=input()
b=(a[:2]>"12")*2
c=a[2:]>"12"
print(["AMBIGUOUS","MMYY","YYMM","NA"][b+c])

Submission status: Wrong Answer

Solution code:
S=input()
s_1=int(S[:2])
s_2=int(S[2:])

if 0<=s_1<=20 and 0<=s_2<=20:
  if (s_1==0 or 13<=s_1<=20) and 1<=s_2<=12:
    print('YYMM')
  elif 1<=s_1<=12 and (s_2==0 or 13<=s_2<=20):
    print('MMYY')
  elif 1<=s_1<=12 and 1<=s_2<=12:
    print('AMBIGUOUS')
  else:
    print('NA')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
s_1=int(S[:2])
s_2=int(S[2:])

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

Submission status: Wrong Answer

Solution code:
S = input()


def yymm(S):
    yy = int(S[:2])
    mm = int(S[3:])
    return yy >= 0 and (mm >= 1 and mm <= 12)


def mmyy(S):
    mm = int(S[:2])
    yy = int(S[3:])
    return yy >= 0 and (mm >= 1 and mm <= 12)


if yymm(S) and mmyy(S):
    print("AMBIGUOUS")
elif yymm(S):
    print("YYMM")
elif mmyy(S):
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()


def yymm(S):
    yy = int(S[:2])
    mm = int(S[3:])
    return yy >= 1 and (mm >= 1 and mm <= 12)


def mmyy(S):
    mm = int(S[:2])
    yy = int(S[3:])
    return yy >= 1 and (mm >= 1 and mm <= 12)


if yymm(S) and mmyy(S):
    print("AMBIGUOUS")
elif yymm(S):
    print("YYMM")
elif mmyy(S):
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[:2]) < 13
b = int(S[2:]) < 13

if a and b:
    print('AMBIGUOUS')
elif a and not b:
    print('MMYY')
elif (not a) and b:
    print('YYMM')

else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
x = int(s[0:2])
y = int(s[2:4])

if (x > 12 and y > 12 ) or x==0 or y==0:
  print("NA")
elif x<13 and y>12:
  print("MMYY")
elif x>12 and y<13:
  print("YYMM")
elif x<13 and y<13:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:

s = input()
s_up = int(s[0] + s[1])
s_down = int(s[2] + s[3])

if 0 <= s_up <= 12 and 0 <= s_down <= 12:
    print("AMBIGUOUS")
elif 0 <= s_down <= 12:
    print("YYMM")
elif 0 <= s_up<= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
a = input()
b = int(a[:2])
c = int(a[2:])
if 0 < b <= 12 and 0 < c <= 12:
    print("AMBIGUOUS")
elif 0 < b <= 12 and (12 < c or c == 0):
    print("MMYY")
elif (12 < b or c == 0) and 0 < c <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
a = input()
b = int(a[:2])
c = int(a[2:])
if 0 < b <= 12 and 0 < c <= 12:
    print("AMBIGUOUS")
elif 0 < b <= 12 and c > 12:
    print("MMYY")
elif b > 12 and 0 < c <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

a = 10*int(S[0])+int(S[1])
b = 10*int(S[2])+int(S[3])

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

Submission status: Wrong Answer

Solution 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 tail <= 12:
            return "AMBIGUOUS"
        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)

Submission status: Wrong Answer

Solution code:
S = input()

a = 10*int(S[0])+int(S[1])
b = 10*int(S[2])+int(S[3])

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

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution 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:])

    YY = 1
    BOTH = 2
    NA = -1
    head_type = NA
    tail_type = NA

    if head == 0:
        head_type = NA
    elif head > 12:
        head_type = YY
    else:
        head_type = BOTH

    if tail == 0:
        tail_type = NA
    elif tail > 12:
        tail_type = YY
    else:
        tail_type = BOTH

    if head_type == NA or tail_type == NA:
        return "NA"
    if head_type == YY and tail_type == YY:
        return "NA"
    if head_type == BOTH and tail_type == BOTH:
        return "AMBIGUOUS"
    if head_type == YY:
        return "YYMM"
    if tail_type == YY:
        return "MMYY"


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


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

Submission status: Wrong Answer

Solution code:
S = input()

a = 10*int(S[0])+int(S[1])
b = 10*int(S[2])+int(S[3])

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

Submission status: Wrong Answer

Solution code:
S = input()

a = 10*int(S[0])+int(S[1])
b = 10*int(S[2])+int(S[3])

if a>12 and b>12:
    print('NA')
elif a>12 and b<=12:
    print('YYMM')
elif a<=12 and b>12:
    print('MMYY')
else:
    print('AMBIGVOUS')

Submission status: Wrong Answer

Solution code:
def judge(s):
    if int(s[0]) == 0:
        if int(s[0]) > 0:
            return 1
        else:
            return 0
    elif int(s[0]) == 1:
        if int(s[1]) <=2:
            return 1
        else:
            return 0
    else:
        return 0

S = input()
tmp = list(S)
first = ''.join([tmp[0],tmp[1]])
second = ''.join([tmp[2],tmp[3]])

flag1 = -1
flag2 = -1

#YYMMがあるか判定　下2桁が01~12であればよい
flag1 = judge(second)

#MMYYがあるか判定
flag2 = judge(first)

#結果発表
if flag1 ==1 and flag2 == 1:
    print("AMBIGUOUS")
elif flag1 == 1 and flag2 == 0:
    print("YYMM")
elif flag1 == 0 and flag2 == 1:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = int(input())

Y = s/100
M = s%100
flag=0
#YYMM
if(M!=0 and M<13):
    flag+=1
#MMYY
if(Y!=0 and Y<13):
    flag+=2

if(flag==0):
    print('NA')
elif(flag==1):
    print('YYMM')
elif(flag==2):
    print('MMYY')
elif(flag==3):
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = int(input())

Y = s/100
M = s%100
flag=0
#YYMM
if(M!=0 and M<13):
    flag+=1
#MMYY
if(Y!=0 and Y<13):
    flag+=2

if(flag==0):
    print('NA')
elif(flag==1):
    print('YYMM')
elif(flag==2):
    print('MMYY')
elif(flag==3):
    print('AMBIGUOS')

Submission status: Wrong Answer

Solution code:
S=str(input())
A=int(S[0]+S[1])
B=int(S[2]+S[3])

if 0<A<=12 and 0<B<=12:
  print('AMBIGUOUS');exit()
elif A>12 and 0<B<=12:
  print('YYMM');exit()
elif 0<A<=12 and B>12:
  print('MMYY');exit()
else:
  print('NA');exit()

Submission status: Wrong Answer

Solution code:
S=str(input())
A=int(S[0]+S[1])
B=int(S[2]+S[3])

if A<=12 and B<=12:
  print('AMBIGUOUS');exit()
elif A>12 and 0<B<=12:
  print('YYMM');exit()
elif 0<A<=12 and B>12:
  print('MMYY');exit()
else:
  print('NA');exit()

Submission status: Wrong Answer

Solution code:
S=str(input())
A=int(S[0]+S[1])
B=int(S[2]+S[3])

if A<=12 and B<=12:
  print('AMBIGUOUS');exit()
elif A>12 and B<=12:
  print('YYMM');exit()
elif A<=12 and B>12:
  print('MMYY');exit()
else:
  print('NA');exit()

Submission status: Wrong Answer

Solution code:
S=str(input())
A=int(S[0]+S[1])
B=int(S[2]+S[3])

if A<=12 and B<=12:
  print('AMBIGUOUS')
elif A>12 and B<=12:
  print('YYMM')
elif A<=12 and B>12:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S=str(input())

if 0<int(S[0]+S[1])<=12 and 0<int(S[2]+S[3])<=12:
  print('AMBIGUOUS');exit()
elif S[0]+S[1]=='00' or S[2]+S[3]=='00':
  print('NA');exit()
elif int(S[0]+S[1])>12:
  print('YYMM');exit()
else:
  print('MMYY');exit()

Submission status: Wrong Answer

Solution code:
S=str(input())

if int(S[0]+S[1])<=12 and int(S[2]+S[3])<=12:
  print('AMBIGUOUS');exit()
elif S[0]+S[1]=='00' or S[2]+S[3]=='00':
  print('NA');exit()
elif int(S[0]+S[1])>12:
  print('YYMM');exit()
else:
  print('MMYY');exit()

Submission status: Wrong Answer

Solution code:
s=(list(input()))

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

if 0<a<13 and 0<b<13:
  print("AMBIGUOUS")
  exit()
if 0<a<13 and (b>13 or b==0):
  print("MMYY")
  exit()
if (a>13 or a==0) and 0<b<13:
  print("YYMM")
  exit()

else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=(list(input()))

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

if 0<a<13 and 0<b<13:
  print("AMBIGUOUS")
  exit()
if 0<a<13 and b>13:
  print("MMYY")
  exit()
if a>13 and 0<b<13:
  print("YYMM")
  exit()
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = str(input())
ss = s[:2]
sss = s[2:]

if "01" <= ss <= "12":
    if "01" <= sss <= "12":
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    if "01" <= sss <= "12":
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
s = str(input())
ss = s[:1]
sss = s[1:]
if "01" <= ss <= "12":
    if "01" <= sss <= "12":
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    if "01" <= sss <= "12":
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

if MM == 0 or YY == 0:
  print("NA")
elif (YY <= 12 and MM <= 12):
  print("AMBIGUOUS")
elif (YY >= 1 and MM <= 12):
  print("YYMM")
elif (MM >= 1 and YY <= 12):
  print("MMYY")

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

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

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0:2])
b = int(s[2:4])

result = ""
if 0 < a < 13 and 0 < b < 13:
    result = "AMBIGUOUS"
elif 0 < a < 100 and 0 < b < 13:
    result = "YYMM"
elif 0 < a < 13 and 0 < b < 100:
    result = "MMYY"
else:
    result = "NA"

print(result)

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0:2])
b = int(s[2:4])

result = ""
if 0 < a < 13 and 0 < b < 13:
    result = "AMBIGUOUS"
elif 0 < a and 0 < b < 13:
    result = "YYMM"
elif 0 < a < 13 and 0 < b:
    result = "MMYY"
else:
    result = "NA"

print(result)

Submission status: Wrong Answer

Solution code:
S = input()

A = S[:2]
B = S[2:] 

if len(S) == 4:
  if int(A) >= 1 and int(A) <= 12 and int(B) >= 1 and int(B) <= 12:
    print('AMBIGUOUS')
  elif int(A) >= 1 and int(A) <= 12 and int(B) >= 1 and int(B) <=99:
    print('MMYY')
  elif int(A) >= 1 and int(A) <= 99 and int(B) >= 1 and int(B) <= 12:
    print('YYMM')
  else:
    print('NA')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

A = S[:2]
B = S[2:]

if int(A) >= 1 and int(A) <= 12 and int(B) >= 1 and int(B) <= 12:
  print('AMBIGUOUS')
elif int(A) >= 1 and int(A) <= 12 and int(B) >= 1 and int(B) <=99:
  print('MMYY')
elif int(A) >= 1 and int(A) <= 99 and int(B) >= 1 and int(B) <= 12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

A = S[:2]
B = S[2:]

if int(A) >= 1 and int(A) <= 12 and int(B) >= 1 and int(B) <= 12:
  print('AAMBIGUOUS')
elif int(A) >= 1 and int(A) <= 12 and int(B) >= 1 and int(B) <=99:
  print('MMYY')
elif int(A) >= 1 and int(A) <= 99 and int(B) >= 1 and int(B) <= 12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

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

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

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

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

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

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

if MM == 0 or YY == 0:
  print("NA")
elif (YY<=12 and MM <=12):
  print("AMBIGUOUS")
elif (YY>=1 and MM <=31):
  print("YYMM")
elif (MM>=32):
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

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

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

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

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

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

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

if (MM == 0 or YY == 0):
  print("NA")
elif (YY<=12 and MM <=12):
  print("AMBIGUOUS")
elif (YY>=1 and MM <=12):
  print("YYMM")
elif (MM>=1 and YY <=12):
  print("MMYY")

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

if MM == 0 or YY == 0:
  print("NA")
elif YY<=12 and MM <=12:
  print("AMBIGUOUS")
elif YY>=1 and MM <=12:
  print("YYMM")
elif MM>=1 and YY <=12:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
S = list(input())
YY = int(''.join(S[:2]))
MM = int(''.join(S[2:]))

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

Submission status: Wrong Answer

Solution 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')

Submission status: Wrong Answer

Solution code:
s = input()

front = s[:2]
back =s[2:]

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

Submission status: Wrong Answer

Solution code:
s = input()

front = s[:2]
back =s[2:]

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

Submission status: Wrong Answer

Solution code:
s = input()

front = s[:2]
back =s[2:]

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

Submission status: Wrong Answer

Solution code:
s = input()

front = s[:2]
back =s[2:]

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

Submission status: Wrong Answer

Solution code:
s = input()

front = s[:2]
back =s[2:]

if front == "00" or back == "00":
    print("NA")
elif 1 <= int(back) <= 12:
    if 1 <= int() <= 12:
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
def main():
    s = int(input())

    front = s // 100
    behind = s % 100

    if 0<front<=12 and 0<behind<=12:
        print("AMBIGUOUS")
    elif front>12 and behind==00:
        print("NA")
    elif front==00 and behind>12:
        print("NA")
    elif front>12 and behind<=12:
        print("YYMM")
    elif front<=12 and behind>12:
        print("MMYY")

main()

Submission status: Wrong Answer

Solution code:
def main():
    s = int(input())

    front = s // 100
    behind = s % 100

    if front<=12 and behind<=12:
        print("AMBIGUOUS")
    elif front>12 and behind==00:
        print("NA")
    elif front==00 and behind>12:
        print("NA")
    elif front>12 and behind<=12:
        print("YYMM")
    elif front<=12 and behind>12:
        print("MMYY")
        
main()

Submission status: Wrong Answer

Solution code:
s = list(input())

if int(s[0]+s[1])>12 and 0<int(s[2]+s[3])<=12:
  print("YYMM")
  
elif 0<int(s[0]+s[1])<=12 and int(s[2]+s[3])>12:
  print("MMYY")
  
elif 0<int(s[0]+s[1])<=12 and 0<int(s[2]+s[3])<=12:
  print("AMBIGUOUS")
  
elif int(s[0]+s[1])==0 and 0<int(s[2]+s[3])<=12:
  print("YYMM")
  
elif int(s[2]+s[3])==0 and 0<int(s[0]+s[1])<=12:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
s = list(input())

if int(s[0]+s[1])>12 and 0<int(s[2]+s[3])<=12:
  print("YYMM")
  
elif 0<int(s[0]+s[1])<=12 and int(s[2]+s[3])>12:
  print("MMYY")
  
elif 0<int(s[0]+s[1])<=12 and 0<int(s[2]+s[3])<=12:
  print("AMBIGUOUS")
  
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
ls = ['01','02','03','04','05','06','07','08','09','10','11','12']
for x in ls:
    if x == S[:2]:
        for x in ls:
            if x == S[2:]:
                print('AMBIGUOUS')
            else:
                print('MMYY')
    else:
        for x in ls:
            if x == S[2:]:
                print('YYMM')
            else:
                print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
if 13 <= int(s[0:2:]) :
    if 1 <= int(s[2::]) <= 12:
        print('YYMC')
    else:
        print('NA')
elif 1 <= int(s[0:2:]) <= 12:
    if  13 <= int(s[2::]) or int(s[2::]) == 0 :
        print('MMYY')
    else:
        print('AMBIGUOUS')
elif int(s[0:2:]) == 0:
    if 1 <= int(s[2::]) <= 12:
        print('YYMM')
    else:
        print('NA')