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

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

Submission status: Wrong Answer

Solution code:
s = input().rstrip()

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(map(int,input()))
a=10*s[0]+s[1]
b=10*s[2]+s[3]
if a<=12 and b<=12:
    print('AMBIGUOUS')
elif a+b==0:
    print('NA')
elif a>12 and b>12:
    print('NA')
elif a==0 and b>12:
    print('NA')
elif b==0 and a>12:
    print('NA')
elif 0<a<=12 and 12<b:
    print('MMYY')
elif 0<b<=12 and 12<a:
    print('YYMM')
elif 0<a<=12 and 0==b:
    print('MMYY')
elif 0<b<=12 and 0==a:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
s=list(map(int,input()))
a=10*s[0]+s[1]
b=10*s[2]+s[3]
if a<=12 and b<=12:
    print('AMBIGUOUS')
elif a+b==0:
    print('NA')
elif a>12 and b>12:
    print('NA')
elif a==0 and b>12:
    print('NA')
elif b==0 and a>12:
    print('NA')
elif 0<a<=12 and 12<b:
    print('MMYY')
elif 0<b<=12 and 12<a:
    print('YYMM')
elif 0<a<=12 and 0==b:
    print('MMYY')
elif 0<b<=12 and 1==a:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input().strip()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if (first_half == [True, True] and second_half == [True, True]):
  print('AMBIGUOUS')
elif first_half[0] is True and second_half[1] is True:
  print('MMYY')
elif first_half[1] == False and second_half[0] is True:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input().strip()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if first_half == [True, False] and second_half[1] is True:
  print('MMYY')
elif first_half == [False, True] and second_half[0] is True:
  print('YYMM')
elif (first_half == [True, True] and second_half == [True, True]):
  print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if first_half[0] is True and first_half[1] is False and \
   second_half[1] is True:
  print('MMYY')
elif first_half[0] is False and first_half[1] is True and \
   second_half[0] is True:
  print('YYMM')
elif (first_half == [True, True] and second_half == [True, True]):
  print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if first_half[0] is True and first_half[1] is False and \
   second_half[1] is True:
  print('MMYY')
elif first_half[0] is False and first_half[1] is True and \
   second_half[0] is True:
  print('YYMM')
elif (first_half == [True, True] and second_half == [True, False]) or \
   (first_half == [True, True] and second_half == [False, True]) or \
   (first_half == [True, False] and second_half == [True, True]) or \
   (first_half == [False, True] and second_half == [True, True]):
  print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if first_half[0] is True and first_half[1] is False and \
   second_half[1] is True:
  print('MMYY')
elif first_half[0] is False and first_half[1] is True and \
   second_half[0] is True:
  print('YYMM')
elif (first_half[0] is False and second_half[1] is False) or \
   (second_half[0] is False and first_half[1] is False):
  print('NA')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if first_half[0] is True and first_half[1] is False and \
   second_half[1] is True:
  print('MMYY')
elif first_half[0] is False and first_half[1] is True and \
   second_half[0] is True:
  print('YYMM')
elif first_half[0] is True and first_half[1] is True and \
   second_half[0] is True and second_half[1] is True:
  print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

S_zen =int(S[0:2])
S_go = int(S[2:4])

judge_list_MM = [1+i for i in range(12)]

#print(judge_list_MM)


if S_zen ==0 or S_go ==0:
    print("NA")
if S_zen in judge_list_MM :
    print("MMYY")
elif S_go in judge_list_MM :
    print("YYMM")
elif S_zen in judge_list_MM and S_go in judge_list_MM :
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()

S_zen =int(S[0:2])
S_go = int(S[2:4])

judge_list_MM = [1+i for i in range(12)]

print(judge_list_MM)


if S_zen ==0 or S_go ==0:
    print("NA")
if S_zen in judge_list_MM :
    print("MMYY")
elif S_go in judge_list_MM :
    print("YYMM")
elif S_zen in judge_list_MM and S_go in judge_list_MM :
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

if b and a:
    print("AMBIGUOUS")
elif b:
    print("MMYY")
elif a:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
b = 0 < int(S[0:2]) < 12
a = 0 < int(S[3:]) < 12

if b and a:
    print("AMBIGUOUS")
elif b:
    print("MMYY")
elif a:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
day = input()

aa = day[:2]
bb = day[2:]

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

Submission status: Wrong Answer

Solution code:
day = input()

aa = day[:2]
bb = day[2:]

if 1<= int(aa) <= 12 and 1<= int(bb) <= 99:
  print('MMYY')
elif 1<= int(aa) <= 99 and 1<= int(bb) <= 12:
  print('YYMM')
elif 1<= int(aa) <= 12 and 1<= int(bb) <= 12:
  print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = input()

if 1<= int(S[0:2]) <= 12 and 1 <= int(S[3:5]) <= 12:
    print("AMBIGUOUS")
elif 1<= int(S[0:2]) <= 12 and (int(S[3:5]) > 12 or int(S[3:5]) == 0):
    print("MMYY")
elif (int(S[0:2]) > 12 or int(S[0:2]) == 0) and 1 <= int(S[3:5]) <= 12:
    print("YYNN")
else:
    print("NA")

Submission status: Wrong Answer

Solution 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 and int(lst1[1])>=13:
      print("MMYY")
elif 0<int(lst1[1])<=12 and int(lst1[0])>=13:
      print("YYMM")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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 int(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 and int(lst1[1])>=13:
      print("MMYY")
elif 0<int(lst1[1])<=12 and int(lst1[0])>=13:
      print("YYMM")

Submission status: Wrong Answer

Solution 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 int(lst1[1]) =="00") or (lst1[0] =="00" and int(lst1[1]) >=13):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12 and int(lst1[1])>=13:
      print("MMYY")
elif 0<int(lst1[1])<=12 and int(lst1[0])>=13:
      print("YYMM")

Submission status: Wrong Answer

Solution code:
#coding:utf-8
s = int(input())

#上の2桁
up = s // 100
#下の2桁
down = s % 100

#AMBIGUOUS
if  up >= 1 and up <= 12 and down >=1 and down <= 12:
    print("AMBIGUOUS")
#NA
elif down == 0 or down > 12:
    print("NA")

#MMYY
elif up >= 1 and up <=12:
    print("MMYY")
#MMYY
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
S = list(input())

A = int(''.join(S[:2]))
B = int(''.join(S[2:]))

ans = ''
if 1 <= A <= 12 and 1 <= B <= 12:
    ans = 'AMBIGUOUS'
elif A > 12 and 1 <= B <= 12:
    ans = 'YYMM'
elif 1 <= A <= 12 and B > 12:
    ans = 'MMYY'
else:
    ans = 'NA'

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def test():
    n = list(input())
    a = int(n[0]+n[1])
    b = int(n[2]+n[3])
    if a > 12:
        if b == 0 or b > 12:
            print("NA")
        else:
            print("YYMM")
    elif a <= 12:
        if b <= 12:
            print("AMBIGUNOUS")
        elif b > 12:
            print("NA")
        else:
            print("MMYY")


if __name__ == "__main__":
    test()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
S = int(input())

X = int(S / 100) #上2桁
Z = S % 100      #下2桁
if 1 <= X and X <= 12 and 1 <= Z and Z <= 12:
    print("AMBIGUOUS")
elif X == 0 or 13 <= X and 1 <= Z and Z <= 12:
    print("YYMM")
elif 1 <= X and X <= 12 and Z == 0 or 13 <= Z:
    print("MMYY")
elif X == 0 or 13 <= X and Z == 0 or 13 <= Z:
    print("NA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
S = int(input())

X = int(S / 100)
Z = S % 100
if 1 <= Z and Z <= 9:
    print("YYMM")
elif 10 <= Z and Z <= 12:
    print("AMBIGUOUS")
elif 1 <= X and X <= 12 :
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

# coding: utf-8
# Your code here!

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

# coding: utf-8
# Your code here!

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
S = list(input())
FF = ''
RR = ''
J = [0] * 2

for st in S[0],S[1]:
	FF += st

for st in S[1],S[3]:
	RR += st

if 1 <= int(FF) <= 12:
	J[0] = 1
else:
	J[0] = 0

if 1 <= int(RR) <= 12:
	J[1] = 1
else:
	J[1] = 0

if J[0] == 0 and J[1] == 0:
	print('NA')
elif J[0] == 0 and J[1] == 1:
	print('YYMM')
elif J[0] == 1 and J[1] == 0:
	print('MMYY')
else:
	print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S=input()
bf=int(S[:2])
af=int(S[2:])
if 1 <= bf<=12 and 1<= af <=12:
  print("AMBIGUOUS")
elif (bf>12 and af==0) or (af>12 and bf==0) or  (af==0 and bf==0) or(af>12 and bf>12):
  print('NA')
elif bf>12:
  print('YYMM')
else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:
S=input()
bf=int(S[:2])
af=int(S[2:])
if 1 <= bf<=12 and 1<= af <=12:
  print("AMBIGUOUS")
elif (bf>12 and af==0) or (af>12 and bf==0) or  (af==0 and bf==0):
  print('NA')
elif bf>12:
  print('YYMM')
else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:
S=input()
bf=int(S[:2])
af=int(S[2:])
if bf<=12 and af <=12:
  print("AMBIGUOUS")
elif bf>12 and af==0 or af>12 and bf==0:
  print('NA')
elif bf>12:
  print('YYMM')
else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:
s = list( map( int, input() ) )

n1 = s[0]*10 + s[1]
n2 = s[2]*10 + s[3]

if (n1 == 0 or n2 == 0) or (n1 > 12 and n2 > 12):
    print('NA')
elif n1 <= 12 and n2 <= 12:
    print('AMBIGUOUS')
elif n1 <= 12:
    print('MMYY')
else:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
s = list( map( int, input() ) )

n1 = s[0]*10 + s[1]
n2 = s[2]*10 + s[3]

if n1 == 0 or n2 == 0:
    print('NA')
elif n1 <= 12 and n2 <= 12:
    print('AMBIGUOUS')
elif n1 <= 12:
    print('MMYY')
elif n2 <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = list( map( int, input() ) )

n1 = s[0]*10 + s[1]
n2 = s[2]*10 + s[3]

if n1 == 0 or n2 == 0:
    print('NA')
elif n1 <= 12 and n2 <= 12:
    print('AMBIGUOUS')
elif n1 <= 12:
    print('MMYY')
else:
    print('YYMM')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline

s = input().strip()

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

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

Submission status: Wrong Answer

Solution code:
import math
import copy

inputa = input().split()
# inputb = input().split()

# a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

a = inputa[0]
inputList = list(a)

# x = int(inputb[0])
# y = int(inputb[1])

# inputList=[]
# for i in range(a):
#     inputNum = input()
#     inputList.append(inputNum)

tmptop = [inputList[0], inputList[1]]
tmpjointop = "".join(tmptop)
top = int(tmpjointop)

tmpbottom = [inputList[2], inputList[3]]
tmpjoinbottom = "".join(tmpbottom)
bottom = int(tmpjoinbottom)

flgFrontMM = 1
flgTermMM = 1

if top > 12 or top == 0:
    flgFrontMM = 0

if bottom > 12 or bottom == 0:
    flgTermMM = 0

if flgFrontMM and flgTermMM:
    print("AMBIGUOUS")
elif flgFrontMM:
    print("YYMM")
elif flgTermMM:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
first = s[0] + s[1]
second = s[2] + s[3]
if first <= "12" and first >= "01" and second <= "12" and second >= "01":
    print("AMBIGUOUS")
elif first <= "12" and first >= "01" and second >= "01":
    print("MMYY")
elif second <= "12" and second >= "01" and first >= "01":
    print("YYMM")
else: 
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
first = s[0] + s[1]
second = s[2] + s[3]
if first == "00" or second == "00":
    print("NA")
elif first >= "13" and second >= "13":
    print("NA")
elif first <= "12" and first >= "01" and second <= "12" and second >= "01":
    print("AMBIGUOUS")
elif first <= "12" and first >= "01":
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
first = s[0] + s[1]
second = s[2] + s[3]
print(first,second)
if first == "00" or second == "00":
    print("NA")
elif first >= "13" and second >= "13":
    print("NA")
elif first <= "12" and first >= "01" and second <= "12" and second >= "01":
    print("AMBIGUOUS")
elif first <= "12" and first >= "01":
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
first = s[0] + s[1]
second = s[2] + s[3]
if first == "00" or second == "00":
    print("NA")
elif first <= "12" and first >= "01" and second <= "12" and second >= "01":
    print("AMBIGUOUS")
elif first <= "12" and first >= "01":
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
first = s[0] + s[1]
second = s[2] + s[3]
print(first,second)
if first == "00" or second == "00":
    print("NA")
elif first <= "12" and first >= "01" and second <= "12" and second >= "01":
    print("AMBIGUOUS")
elif first <= "12" and first >= "01":
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
data=list(input())
a=10*int(data[0])+int(data[1])
b=10*int(data[2])+int(data[3])
if a==0 or b==0:
    print("NA")
elif a>12 and b>12:
    print("NA")
elif 0<a<=12 and 0<b<=12:
    print('AMBIGUOUS')
elif 0<=a<=12 and  12<b:
    print("MMYY")
elif 0<=b<=12 and 12<a:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
data=list(input())
a=10*int(data[0])+int(data[1])
b=10*int(data[2])+int(data[3])
if a==0 or b==0:
    print("NA")
elif a>12 and b>12:
    print("NA")
elif 0<a<=12 and 0<b<=12:
    print('AMBIGUOUS')
elif 0<a<=12 and  12<b:
    print("MMYY")
elif 0<b<=12 and 12<a:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

if int(s[:2]) > 13 and int(s[2:]) > 13:
    print('NA')

elif int(s[:2]) < 13 and int(s[2:]) < 13:
    print('AMBIGUOUS')

elif int(s[:2]) < 13 and int(s[2:]) > 13:
    print('MMYY')

elif int(s[:2]) > 13 and int(s[2:]) < 13:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
s=input()
sf=int(s[:2])
sl=int(s[2:])

if sf>12 and sl<=12 and 0<sl:
  print("YYMM")
elif sf<=12 and 0<sf and sl>12:
  print("MMYY")
elif sf<=12 and sl<=12 and sf*sl!=0:
  print("AMBIGUOUS")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])
if s2 == 0:
  print('NA')
elif s1 <=12 and s2 <= 12:
  print('AMBIGUOUS')
elif s1 > 12 and s2 > 12:
  print('NA')
elif s1 > 12:
  print('YYMM')
else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])
if s1 <=12 and s2 <= 12:
  print('AMBIGUOUS')
elif s2 == 0:
  print('NA')
elif s1 > 12 and s2 > 12:
  print('NA')
elif s1 > 12:
  print('YYMM')
else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])
if s1 <=12 and s2 <= 12:
  print('AMBIGUOUS')
elif s1 > 12 and s2 > 12:
  print('NA')
elif s1 > 12:
  print('YYMM')
else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:
N = input()
s = int(N[:2])
t = int(N[2:])
if s>=1 and s<=12:
	if t>=1 and t <=12:
		print("AMBIGIOUS")
	else :
		print("MMYY")
else:
	if t>= 1 and t<= 12:
		print("YYMM")
	else:
		print("NA")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input()))
x=s[0]*10+s[1]
y=10*s[2]+s[3]
if x>12 and y>0 and y<=12:
  print("YYMM")
elif x>0 and x<=12 and y>12:
  print("MMYY")
elif x<=12 and x>0 and y>0 and y<=12:
  print("AMBIGUOUS")
elif x==0 and y<=12 and y>0:
  print("YYMM")
elif y==0 and x>0 and x<=12:
  print("MMYY")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input()))
x=s[0]*10+s[1]
y=10*s[2]+s[3]
if x>12 and y>0 and y<=12:
  print("YYMM")
elif x>0 and x<=12 and y>12:
  print("MMYY")
elif x<=12 and x>0 and y>0 and y<=12:
  print("AMBIGUOUS")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input()))
x=s[0]*10+s[1]
y=10*s[2]+s[3]
if x>12 and y>0 and y<=12:
  print("YYMM")
elif x>0 and x<12 and y>12:
  print("MMYY")
elif x<=12 and x>0 and y>0 and y<=12:
  print("AMBIGUOUS")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
# YYMM or MMYY
S = int(input())

A = S // 100
B = S - (A* 100)
# YY確認
if 1 <= A <=12:
    if 13 <= B <=99 or B == 0:
        print('YYMM')
    else : #1 <= B <= 12
        print('AMBIGUOUS')
elif 1 <= B <= 12:
    if 13 <= A <=99 or A == 0:
        print('MMYY')
    else : #1 <= B <= 12
        print('AMBIGUOUS')
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())

YM = ((int(s[:2]) <= 12),(int(s[:2]) <= 12))
ans = 'AMBIGUOUS' if YM == (True,True) else ''
ans = 'MMYY' if YM == (True,False) else ''
ans = 'YYMM' if YM == (False,True) else ''
ans = 'NA' if YM == (False,False) else ''

print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())

YM = ((int(s[:2]) <= 12),(int(s[:2]) <= 12))
ans = 'AMBIGUOUS' if YM == (True,True) else ''
ans = 'MMYY' if YM == (True,False) else ''
ans = 'YYMM' if YM == (False,True) else ''
ans = 'NA' if YM == (False,False) else ''

print('ans')

Submission status: Wrong Answer

Solution code:
s = str(input())
if ((int(s[:2])==0) | (int(s[2:])==0)) | ((int(s[:2])>12) & (int(s[2:])>12)):
	ans = "NA"
elif ((int(s[:2])>12) & (int(s[2:])<=12)):
	ans = "YYMM"
elif ((int(s[:2])>12) & (int(s[2:])<=12)):
	ans = "MMYY"
else:
	ans = "AMBIGUOUS"

print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())
if ((s[:2]=="00") | (s[2:]=="00")) | ((int(s[:2])>12) & (int(s[2:])>12)):
	ans = "NA"
elif ((int(s[:2])>12) & (int(s[2:])<=12)):
	ans = "YYMM"
elif ((int(s[:2])>12) & (int(s[2:])<=12)):
	ans = "MMYY"
else:
	ans = "AMBIGUOUS"

print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())
if ((s[:2]=='00') | (s[2:]=='00')) | ((int(s[:2])>12) & (int(s[2:])>12)):
	ans = 'NA'
elif ((int(s[:2])<=12) & (int(s[2:])<=12)):
	ans = 'AMBIGUOUS'
elif ((int(s[:2])>12) & (int(s[2:])<=12)):
	ans = 'YYMM'
else:
	ans = 'MMYY'
print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())
if ((s[:2]=='00') | (s[2:]=='00')):
	ans = 'NA'
elif ((int(s[:2])<=12) & (int(s[2:])<=12)):
	ans = 'AMBIGUOUS'
elif ((int(s[:2])>12) & (int(s[2:])<=12)):
	ans = 'YYMM'
else:
	ans = 'MMYY'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding: utf-8

S = input()


def valid_my(mon, day):
    m = int(mon)
    d = int(day)

    if m <= 0 or 13 <= m:
        return False

    if d <= 0 or 32 <= d:
        return False

    if m == 2:
        return 1 <= d and d <= 29

    if m in (4, 6, 9, 11):
        return 1 <= d and d <= 30

    else:
        return 1 <= d and d <= 31


def valid_ym(year, mon):
    y = int(year)
    m = int(mon)

    if m <= 0 or 13 <= m:
        return False

    return True


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

my = valid_my(A, B)
ym = valid_ym(A, B)

if my and ym:
    print("AMBIGUOUS")
elif my:
    print("MMYY")
elif ym:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
F = int(S) // 100
B = int(S) % 100
print(F)
print(B)
if (F <= 12 and F > 0) and (B <= 12 and B > 0):
  print("AMBIGUOUS")
elif F <= 12 and F > 0:
  print("MMYY")
elif B <= 12 and B > 0:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
F = int(S) // 100
B = int(S) % 100
if (F <= 12 & F > 0) & (B <= 12 & B > 0):
  print("AMBIGUOUS")
elif F <= 12 and F > 0:
  print("MMYY")
elif B <= 12 and B > 0:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
F = int(S) // 100
B = int(S) % 100
if (F <= 12 & F > 0) & (B <= 12 & B > 0):
  print("AMBIGUOUS")
elif F <= 12 & F > 0:
  print("MMYY")
elif B <= 12 & B > 0:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

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

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