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:
if __name__ == "__main__":
    s = input()

    i1 = int(s[0:2])
    i2 = int(s[2:4])

    print(i1)
    print(i2)

    ans = ""
    if i1 < 1 or i2 < 1:
        ans = "NA"
    else:
        if i1 < 13:
            if i2 < 13:
                ans = "AMBIGUOUS"
            else:
                ans = "MMYY"
        else:
            if i2 < 13:
                ans = "YYMM"
            else:
                ans = "NA"
    print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

mae = int(S[:2])
ato = int(S[2:])

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

Submission status: Wrong Answer

Solution code:
s=int(input())
k=s%100
l=(s-k)/100
k=int(k)
l=int(l)
if k<=12 & k>=1:
    if l>=1 and l<=12:
        ans='ANBIGUOUS'
    else:
        ans='MMYY'
elif l>=1 and l<=12:
    ans='YYMM'
else:
    ans='NA'
print(ans)

Submission status: Wrong Answer

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

if l == 0:
    print('NA')

elif u == 0 and 0 < l and l < 13:
    print('YYMM')

elif 0 < l and l < 13:

    if 0 < u and u < 13:
        print('AMBIGUOUS')
    else:
        print("YYMM")


elif 0 < u and u < 13:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s=input()
if 10*int(s[2])+int(s[3])>=13:
  if int(s[0])+int(s[1])==0:
    print("NA")
  else:
    print("MMYY")
if 10*int(s[0])+int(s[1])>=13:
  if int(s[2])+int(s[3])==0:
    print("NA")
  else:
    print("YYMM")
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = list(input())
S1 = int(S[0] + S[1])
S2 = int(S[2] + S[3])
if  S1 == 0 or S2 == 0:
    if 1 <= S2 <= 12:
        print("YYMM")
    elif 1<= S1 <= 12:
        print("MMYY")
    else:
        print("NA")
elif S2 <= 12 and S1 <= 12:
    print("AMBIGUOUS")
elif S2 <= 12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
input_int = lambda:int(input())
input_ints = lambda:map(int,input().split())
input_ints_list = lambda:list(input_ints())
input_str = lambda:input()
input_strs = lambda:input().split()
input_lines = lambda n,input_func:[input_func() for _ in range(n)]

import importlib
import_module = lambda module_name:importlib.import_module(module_name)

init_array_1dim = lambda value,n:[value]*n # 1次元配列を生成
init_array_2dim = lambda value,n,m:[init_array_1dim(value,n) for _ in range(m)] # 2次元配列を生成

gcd_base = lambda value1,value2:import_module('fractions').gcd(value1,value2) # 最大公約数（2値)
gcd = lambda lst:import_module('functools').reduce(gcd_base,lst) # 最大公約数（リスト）
lcm_base = lambda value1,value2:(value1*value2)//gcd_base(value1,value2) # 最小公倍数(2値)
lcm = lambda lst:import_module('functools').reduce(lcm_base,lst,1) # 最小公倍数(リスト)

permutations = lambda lst,n:import_module('itertools').permutations(lst,n) # 順列
combinations = lambda lst,n:import_module('itertools').combinations(lst,n) # 組み合わせ
product = lambda lst1,lst2:import_module('itertools').product(lst1,lst2) # 二つのリストの直積

round = lambda value:round(value) # 四捨五入
ceil = lambda value:import_module('math').ceil(value) # 切り上げ
floor = lambda value:import_module('math').floor(value) # 切り捨て

# キュー
init_q = lambda lst: import_module('collections').deque(lst)
q_pop = lambda q: q.popleft() # 先頭から取り出し
q_push = lambda q,value:q.appendleft(value) # 先頭に追加（値）
q_pushlist = lambda q,lst:q.extendleft(lst) # 先頭に追加（リスト）
q_append = lambda q,value:q.append(value) # 末尾に追加（値）
q_appendlist = lambda q,lst:q.extend(lst) # 末尾に追加（リスト）

# プライオリティキュー
init_heap = lambda a:import_module('heapq').heapify(a)
heap_push = lambda a,v:import_module('heapq').heappush(a,v)
heap_pop = lambda a:import_module('heapq').heappop(a) # 最小値を取り出す

def solution():
    # ここに実装
    S = input_str()

    month_1 = False
    year_1 = False
    if '01'<=S[:2]<='12':month_1 = True
    if '01'<=S[:2]<='19':year_1 = True
    month_2 = False
    year_2 = False
    if '01'<=S[2:]<='12':month_2 = True
    if '01'<=S[2:]<='19':year_2 = True
    
    if month_1 and month_2:
        print('AMBIGUOUS')
        return
    if month_1 and year_2:
        print('MMYY')
        return
    if month_2 and year_1:
        print('YYMM')
        return
    print('NA')

if __name__ == '__main__':
    solution()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def check(S) :
    mae = int(S[:2])
    ato = int(S[2:])
    if mae == 0 :
        return "NA"
    if ato == 0 :
        return "NA"
    if mae < 13 and ato < 13 :
        return "AMBIGUOUS"
    if mae < 13 and ato >12 :
        return "MMYY"
    if mae > 12 and ato < 12 :
        return "YYMM"
    if mae > 12 and ato > 12 :
        return "NA"

S = input()
print(check(S))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = str(input())
b = n[:2]
a = n[2:]
be = int(b)
af = int(a)
if 13 <= be <=99 and 1 <=af<=12:
    print("YYMM")
elif 1<=be<=12 and 13 <=af<=99:
    print("MMYY")
elif 1<=be<=12 and 1<=af<=12:
    print(" AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

ans = ''
if int(s[0:2])>12 and int(s[2:4])==0:
  ans = 'NA'
elif int(s[0:2])>12 and int(s[2:4])>0:
  ans = 'YYMM'
elif 0<int(s[0:2]) and int(s[0:2])<=12 and int(s[2:4])==0:
  ans = 'MMYY'
elif 0<int(s[0:2]) and int(s[0:2])<=12 and int(s[2:4])<=12:
  ans = 'AMBIGOUS'
elif 0<int(s[0:2]) and int(s[0:2])<=12 and int(s[2:4])>12:
  ans = 'MMYY'
elif 0==int(s[0:2]) and 0<int(s[2:4]) and int(s[2:4])<=12:
  ans = 'YYMM'
else:
  ans = 'NA'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=int(input())

if S>1299 and S%100>12 or S<100 or S%100==0:
    print('NA')
elif S>1299 and S%100<=12:
    print('YYMM')
elif S<1300 and S%100>12:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
fore = S[0:2]
back = S[2:4]
yymm_flag = False
mmyy_flag = False
if int(fore) > 12:
  yymm_flag = True
  mmyy_flag = False
  if int(back) > 12:
    yymm_flag = False
  elif int(back) <= 12:
    yymm_flag = True
elif int(fore) <= 12:
  yymm_flag = False
  mmyy_flag = True
  if int(back) > 12:
    mmyy_flag = True
  elif int(back) <= 12:
    yymm_flag = True

if yymm_flag == True and mmyy_flag == False:
  print("YYMM")
elif yymm_flag == False and mmyy_flag == True:
  print("MMYY")
elif yymm_flag == True and mmyy_flag == True:
  print("AMBIGUOUS")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
def isYear(s):
    try:
        s_int = int(s)
        if s_int == 0:
            return False
        else:
            return True
    except ValueError:
        return None


def isMonth(s):
    try:
        s_int = int(s)
        if s_int == 0 or s_int > 12:
            return False
        else:
            return True
    except ValueError:
        return None


if __name__ == '__main__':
    s = input()
    # MMは01-12 YY 01-99
    yy_1 = isYear(s[0:2])
    mm_1 = isMonth(s[0:2])
    yy_2 = isYear(s[2:4])
    mm_2 = isMonth(s[2:4])

    if yy_1 is None or mm_2 is None:
        print("NA")
    else:
        yymm = yy_1 and mm_2
        mmyy = mm_1 and yy_2

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

Submission status: Wrong Answer

Solution code:
S = list(input())
s1 = [S[0],S[1]]
s2 = [S[2],S[3]]
s1 = int("".join(s1))
s2 = int("".join(s2))

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

elif s1 <1 or s2<1:
    print("NA")

elif s1 >0 and s1 <13 and s2>0 and s2 <13:
    print("AMBIGUOUS")

elif s1 > 0 and s2 < 13:
    print("YYMM")

elif s1 < 13 and s2 > 0:
    print("MMYY")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())
YY = S // 100
MM = S % 100

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

Submission status: Wrong Answer

Solution code:
S=input()
AA=int(S[:2])
BB=int(S[2:])
print(["NA","MMYY","YYMM","AMBIGUOUS"][
    (AA<=12)+2*(BB<=12)
    ])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = map(int, list(raw_input()))

large_num = S[0]*10 + S[1]
min_num = S[2]*10 + S[3]

if large_num <= 0 and min_num <= 0: print 'NA'
elif large_num <= 0 and min_num > 12: print 'YYMM'
elif min_num <= 0 and large_num > 12: print 'MMYY'
elif large_num <= 12 and min_num <= 12: print 'AMBIGUOUS'
elif large_num <= 12: print 'MMYY'
elif min_num <= 12: print 'YYMM'
else: print 'NA'

Submission status: Wrong Answer

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


S = input()

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
input = sys.stdin.readline
ymo = input()

a = int(ymo[0:2])
b = int(ymo[2:4])

ans = ""
#00
if a == 0 or b ==0:
    ans = "NA"

#YYMMのみ
elif a > 12 and b < 13:
    ans = "YYMM"

#MMYYのみ
elif a < 13 and b > 12:
    ans = "MMYY"

#どっちも
elif a <13 and b < 13:
    ans = "AMBIGUOUS"

else :
    ans = "NA"

print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
mae=S[:2]
ato=S[2:]
mon_list=("01","02","03","04","05","06","07","08","09","10","11","12")
test=0
if mae in mon_list:
  test=test+1
if ato in mon_list:
  test=test+3

if test==0:
  print("NA")
if test==1:
  print("YYMM")
if test==3:
  print("MMYY")
if test==4:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S=input()
F = S[:2]
B = S[2:]

F_m = 0<int(F)<13
F_y = 0<=int(F)<100
B_m = 0<int(B)<13
B_y = 0<=int(B)<100
YM = F_y + B_m
MY = B_y + F_m
if YM==2 & MY==2:
    print("AMBIGUOUS")
elif YM==2:
    print('YM')
elif MY==2:
    print('MY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
S1=int(S[:2])
S2=int(S[2:])

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

Submission status: Wrong Answer

Solution code:
S = list(input())

p = S[0]+S[1]
q = S[2]+S[3]

p_flag = 0
q_flag = 0

if int(q) == 0 and int(p) == 0:
    print('NA')
elif int(p) == 0:
    print('YYMM')
elif int(q) == 0:
    print('MMYY')
else:
    if int(p) > 12:
        p_flag = 1
    if int(q) > 12:
        q_flag = 1

    if p_flag and q_flag:
        print('NA')
    elif p_flag:
        print('YYMM')
    elif q_flag:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()
q, mod =divmod(int(a), 100)
if q == 0 or mod == 0:
  print("NA")
elif q < 13 :
  if mod < 13 :
    print("AMBIGUOUS")
  else : print("MMYY")
else:
  if mod < 13 :
    print("YYMM")
  else : print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ans = ''
fmt = input()
n1 = int(fmt[:2])
n2 = int(fmt[2:])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
data = list( input() )
n1 = int( data[0] + data[1] )
n2 = int( data [2] + data[3] )

if 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:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
str = list(raw_input())
f = int(str[0]+str[1])
l = int(str[2]+str[3])
# 文字列の入力
ans = ""
if(f > 0 and 13 > f):
    if(l == 0):
        ans = "MMYY"
    if(l > 0 and 13 > l):
        ans = "AMBIGUOUS"
    if(l >= 13):
        ansF= "MMYY"
elif(f == 0):
    if(l == 0):
        ans = "NA"
    if(l > 0 and 13> l):
        ans = "YYMM"
    if(l >= 13):
        ans= "NA"
elif(f>=13):
    if(l == 0):
        ans = "NA"
    if(l > 0 and 13> l):
        ans = "YYMM"
    if(l >= 13):
        ans= "NA"

print ans

Submission status: Wrong Answer

Solution code:
n = input()

if int(n[:2]) == 0 or int(n[2:]) == 0:
    print('NA')
elif int(n[:2]) >12 and int(n[2:]) > 12:
    print('NA')
elif int(n[:2]) >12 and int(n[2:]) < 13:
    print('YYMM')
elif int(n[:2]) <13 and int(n[2:]) > 12:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()

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

if s1 == 0 and s2 == 0:
    print('NA')
elif s1 == 0 and s2 != 0 and s2 < 12:
    print('YYMM')
elif s1 != 0 and s1 < 12 and s2 == 0:
    print('MMYY')
elif s1 > 12 and s2 > 12:
    print('NA')
elif s1 > 12 and s2 <= 12:
    print('YYMM')
elif s1 <= 12 and s2 > 12:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

YM = False
MY = False

if m2 < 13:
  MY = True
if u2 < 13:
  YM = True
if (m2 == 0 and u2 >12) or (u2 == 0 and m2 >12):
  YM = False
  MY = False
  
if YM == False and MY == True:
  print('MMYY')
elif MY == False and YM == True:
  print('YYMM')
elif YM == MY == False:
  print('NA')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S=list(input())
X="".join(S[:2])
Y="".join(S[2:])
X=int(X)
Y=int(Y)
if 12<X and 1<=Y and Y<=12 :
  print("YYMM")
elif 1<=X and X<=12 and 12<Y :
  print("MMYY")
elif 1<=X and X<=12  and 1<=Y and Y<=12 :
  print("AMBIGUOUS")
else :
  print("NA")

Submission status: Wrong Answer

Solution code:
S = raw_input().strip()
a, b = S[0:2], S[2:]

if a == '00' or b == '00':
    print('NA')
    exit()

ia = int(a)
ib = int(b)

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

Submission status: Wrong Answer

Solution code:
S = input()
lead = int(S[:2])
back = int(S[2:])
answer = ""
if(lead > 12 and back <= 12 and back != 0):
    answer = "YYMM"
elif(back > 12 and lead <= 12 and lead != 0):
    answer = "MMYY"
elif(back >= 1 and back <= 12 and lead >= 1 and lead <= 12):
    answer = "AMBIGUOUS"
else:
    answer = "NA"
print(answer)

Submission status: Wrong Answer

Solution code:
def check(S) :
    mae = int(S[:2])
    ato = int(S[2:])
    if mae == 0 :
        return "NA"
    if ato == 0 :
        return "NA"
    if mae < 13 and ato < 13 :
        return "AMBIGUOUS"
    if mae < 13 and ato >12 :
        return "MMYY"
    if mae > 12 and ato < 12 :
        return "YYMM"
    if mae > 13 and ato > 13 :
        return "NA"

S = input()
print(check(S))

Submission status: Wrong Answer

Solution code:
S = 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')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

s = input()


before = int(s[0:2])
after = int(s[2:4])

before_year = False
after_year = False
before_m = False
after_m = False

if before > 12:
    before_year = True
else: before_m = True

if after > 12:
    after_year = True
else: after_m = True

if before ==0 and after_m==True:
    print('YYMM')
elif before==0 or after==0:
    print('NA')
elif before_year==True and after_year==True:
    print('NA')
elif before_m==True and after_m==True:
    print('AMBIGUOUS')
elif before_year==True and after_m==True:
    print('YYMM')
elif before_m==True and after_year==True:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=input()
aa=x[:2]
bb=x[3:]
aa=int(aa)
bb=int(bb)
if 0<aa<=12 and 0==bb:
	print("MMYY")
elif 0==aa and 0<bb<=12:
	print("YYMM")
elif 0<aa<=12 and 0<bb<=12:
	print("AMBIGUOUS")
elif 0<aa<=12:
	print("MMYY")
elif 0<bb<=12:
	print("YYMM")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
import datetime as dt
S = input()
pre = int(S[0:2])
aft = int(S[2:4])

# yymm
try:
    dt.date(int(pre), int(aft), 1)
    flg_yymm = 1
except:
    flg_yymm = 0

# mmyy
try:
    dt.date(int(aft), int(pre), 1)
    flg_mmyy = 1
except:
    flg_mmyy = 0

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

Submission status: Wrong Answer

Solution code:
s=input()

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

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

Submission status: Wrong Answer

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

if(M>12):
  if(Y==0):
    print('NA')
  else:
    print('YYMM')
else:
  if(Y==0):
    print('YYMM')
  else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[0:2])
b = int(S[2:4])
LIST = [False,False]

if 1 <= b <= 12 and a > 0:#YYMM
    LIST[0] = True 
if 1 <= a <= 12 and b > 0:#MMYY
    LIST[1] = True 

if LIST[0] and LIST[1]:
    print("AMBIGUOUS")
elif LIST[0] and not LIST[1]:
    print("YYMM")
elif not LIST[0] and LIST[1]:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
ls=[int(c) for c in s]

if ((ls[0]==1 and ls[1]>2) or (ls[0]==0 and ls[1]==0)) and not ((ls[2]==1 and ls[3]>2) or (ls[2]==0 and ls[3]==0)):
    print("YYMM")
elif ((ls[2]==1 and ls[3]>2) or (ls[2]==0 and ls[3]==0)) and not ((ls[0]==1 and ls[1]>2) or (ls[0]==0 and ls[1]==0)):
    print("MMYY")
elif not ((ls[0]==1 and ls[3]>2) or (ls[2]==0 and ls[3]==0)) and not ((ls[0]==1 and ls[1]>2) or (ls[0]==0 and ls[1]==0)):
    print("AMBIGUOUS")
elif ((ls[0]==1 and ls[1]>2) or (ls[0]==0 and ls[1]==0)) and  ((ls[2]==1 and ls[3]>2) or (ls[2]==0 and ls[3]==0)):
    print("NA")

Submission status: Wrong Answer

Solution code:
s =input()
ym=0
my=0
if 0<int(s[0:2]):
    ym=1
    if int(s[0:2])<=12:
        my=1
if 0<int(s[2:4]):
    my+=1
    if int(s[2:4])<=12:
        ym+=1
        
if ym==2 and my==2:
    print("AMBIGUOUS")    
elif ym==2:
    print("YYMM")
elif my ==2:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

a = False
b = False

if int(s[0:2]) <= 12:
    a = True

if int(s[3:5]) <= 12:
    b = True

if int(s[0:2]) == 0 or int(s[3:5]) == 0:
    print('NA')
    exit()

if a and b:
    print('AMBIGUOUS')
    exit()

if a and not b:
    print('YYMM')
    exit()

if not a and b:
    print('YYMM')
    exit()

Submission status: Wrong Answer

Solution code:
#coding:utf-8

s = list(input())

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

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

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[0:2])
b = int(S[2:4])
LIST = [False,False]

print(a,b)
if 1 <= b <= 12 and a > 0:#YYMM
    LIST[0] = True 
if 1 <= a <= 12 and b > 0:#MMYY
    LIST[1] = True 

if LIST[0] and LIST[1]:
    print("AMBIGUOUS")
elif LIST[0] and not LIST[1]:
    print("YYMM")
elif not LIST[0] and LIST[1]:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import re
list = re.split('(..)', input())[1::2]
a = int(list[0])
b = int(list[1])
if a>=1 and a<=12 and b>=1 and b<=12:
    print("AMBIGUOUS")
elif a>12 and b>=1 and b<=12:
    print("YYMM")
elif a<=12 and a>=1 and b>12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = list(input())
YYMM = False
MMYY = False
 
if s[2] == '1':
    if (s[3] == '0') | (s[3] == '1') | (s[3] == '2'):
        YYMM = True
elif s[2] == '0':
    YYMM = True
 
if s[0] == '1':
    if (s[1] == '0') | (s[1] == '1') | (s[1] == '2'):
        MMYY = True
elif s[0] == '0':
    MMYY = True
 
if YYMM & MMYY:
    print("AMBIGUOUS")
elif YYMM:
    print("YYMM")
elif MMYY:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S= input()
F = S[:2]
B = S[2:]

F_m = 0<int(F)<13
F_y = 0<=int(F)<100
B_m = 0<int(B)<13
B_y = 0<=int(B)<100
YM = F_y + B_m
MY = B_y + F_m
if YM==2 & MY==2:
    print("AMBIGUOUS")
if YM==2:
    print('YYMM')
elif MY==2:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if (0 < first and first < 13) and (0 < second and second < 13):
    print("AMBIGUOUS")

elif 0 < first and (0 < second and second < 13):
    print("YYMM")

elif (0 < first and first < 13) and 0 < second:
    print("MMYY")

else:
    print("NA")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

formar = S[0]+S[1]
latter = S[2]+S[3]

if formar == "00" or latter == "00":
    print("NA")
elif int(formar) > 12 and int(latter) > 12:
    print("NA")
elif int(formar) <= 12 and int(latter) <= 12:
    print("AMBIGUOUS")
elif int(formar) > 12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = int(input())
h = s//100
l = s%100
# print(h,l)

def check_month(i):
    if i <= 12 and i >= 1:
        return True
    else:
        return False

def check_year(i):
    if i != 0:
        return True
    else:
        return False

ym = check_year(h) and check_year(l)
my = check_month(h) and check_year(l)

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
S = stdin.readline().rstrip()
if 13 <= int(S[:2]):
    if 1 <= int(S[2:]) <= 12:
        print('YYMM')
    else:
        print('NA')
elif 1 <= int(S[:2]) <= 12:
    if 1 <= int(S[2:]) <= 12:
        print('AMBIGUOUS')
    elif 13 <= int(S[2:]):
        print('MMYY')
    else:
        print('NA')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
def solve(s):
    if int(s[0:2]) == 0 or int(s[2:4]) == 0:
        print("NA")
        return 0
    if int(s[0:2]) > 12 and int(s[2:4]) > 12:
        print("NA")
        return 0
    if 0 < int(s[0:2]) < 13 and 0 < int(s[2:4]) < 13:
        print("AMBIGUOUS")
        return 0
    elif 0 < int(s[2:4]) < 13:
        print("YYMM")
        return 0
    elif 0 < int(s[0:2]) < 13:
        print("MMYY")
        return 0


if __name__ == "__main__":
    S = input()
    solve(S)

Submission status: Wrong Answer

Solution code:
S = list(input())

p = S[0]+S[1]
q = S[2]+S[3]

p_flag = 0
q_flag = 0

if int(q) <= 0:
    print('NA')
elif int(p) == 0:
    print('YYMM')
else:
    if int(p) > 12:
        p_flag = 1
    if int(q) > 12:
        q_flag = 1

    if p_flag and q_flag:
        print('NA')
    elif p_flag:
        print('YYMM')
    elif q_flag:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = list(input())
S1 = int(S[0] + S[1])
S2 = int(S[2] + S[3])
if  S1 == 0 or S2 == 0:
    if S2 <= 12:
        print("YYMM")
    elif S1 <= 12:
        print("MMYY")
    else:
        print("NA")
elif S2 <= 12 and S1 <= 12:
    print("AMBIGUOUS")
elif S2 <= 12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s=input()
sb=int(s[:2])
sa=int(s[2:])
if sb<=12 and sa!=0:
  if sa<=12 and sa!=0:
    print('AMBIGUOUS')
  else:
    print('MMYY')
elif sa<=12 and sa!=0:
  if sb<=12 and sa!=0:
    print('AMBIGOUS')
  else:
    print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S= input()
F = S[:2]
B = S[2:]

F_m = 0<int(F)<13
F_y = 0<=int(F)<100
B_m = 0<int(B)<13
B_y = 0<=int(B)<100
YM = F_y + B_m
MY = B_y + F_m
if YM==2 & MY==2:
    print("AMBIGUOUS")
if YM==2:
    print('YM')
elif MY==2:
    print('MY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
a,b,c,d=input()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
if 10*a+b==0 or 10*a+b>13:
  if 10*c+d==0 or 10*c+d>13:
    print("NA")
  else:
    print("YYMM")
else:
  if 10*c+d==0 or 10*c+d>13:
    print("MMYY")
  else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
S1 = int(S[:2])
S2 = int(S[2:])
f1 = 0
f2 = 0

if S1 <= 12:
        f1 = 1
if S2 <= 12:
        f2 = 1
if S1 == 0 or S2 == 0:
        print("NA")
elif f1 and f2:
        print("AMBIGUOUS")
elif f1 == 1 and f2 == 0:
        print("MMYY")
elif f1 == 0 and f2 == 1:
        print("YYMM")
else :
        print("NA")

Submission status: Wrong Answer

Solution code:
#coding:utf-8

s = list(input())

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

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

Submission status: Wrong Answer

Solution code:
a = list(input())
if not len(a) == 4:
    ptint('NA') 
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')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input_str = input()
zenhan = int(input_str[:2])
kouhan = int(input_str[3:])

if zenhan > 12:
  if kouhan > 12 :
    print('NA')
  elif kouhan == 0:
    print('NA')
  else:
    print('YYMM')
elif zenhan == 0:
  if kouhan > 12 :
    print('NA')
  elif kouhan == 0:
    print('NA')
  else:
    print('YYMM')
else:
  if kouhan >= 1:
    if kouhan <= 12:
      print('AMBIGUOUS')
    else:
      print('MMYY')
  else:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
S = input()

mae = int(S[0]+S[1])
ato = int(S[2]+S[3])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def get_format(a, b):
  if 0 < a < 12 and 0 < b < 12:
    return 'AMBIGUOUS'
  elif 0 < a < 12:
    return "MMYY"
  elif 0 < b < 12:
    return "YYMM"
  else:
    return 'NA'

s = input()
s1 = int(s[:2])
s2 = int(s[2:])
print(get_format(s1, s2))