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=list(input())
X="".join(S[:2])
Y="".join(S[2:])
X=int(X)
Y=int(Y)
if X==0 or 12<X and 1<=Y and Y<=12 :
  print("YYMM")
elif 1<=X and X<=12 and 12<Y or Y==0:
  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=input()

F=int(S[:2])
A=int(S[2:])

if F==0 and A==0:
    print('NA')
elif F>12 and A>12:
    print('NA')
elif F>12 or F==0:
    print('YYMM')
elif A>12 or A==0:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()
mae = int(a[:2])
usiro = int(a[2:])

if(1 <= mae <= 12):
    if(1 <= usiro <= 12):
        print('UMBIGOUS')
    else:
        print('MMYY')
else:
    if(1 <=usiro <= 12):
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:

def main():
    S = input()

    A = int(S[:2])
    B = int(S[2:])
    print(A, B)

    if A != 0 and B <= 12 and B != 0 and A <= 12:
        print("AMBIGUOUS")

    elif (A != 0 and B <= 12) and B != 0:
        print("YYMM")

    elif (B != 0 and A <= 12) and A != 0:
        print("MMYY")

    else:
        print("NA")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = input()

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

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

Submission status: Wrong Answer

Solution code:
s =input()
li = [(i+j) for (i,j) in zip(s[::2],s[1::2])]

if int(li[0])>12:
  if (int(li[1])>12)|(int(li[1])==0):
  	print('NA')
  else:
    print('YYMM')
else:
  if int(li[1])>12:
    print('MMYY')
  else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

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

if ia == 12 and ib == 0:
    print('MMYY')
    exit()

if ib == 12 and ia == 0:
    print('YYMM')
    exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

former = int(''.join(s[0:2]))
latter = int(''.join(s[2:]))

if former == 0 or latter == 0:
    print('NA')
else:
    former_mm_flag = False
    if former <= 12:
        former_mm_flag = True

    latter_mm_flag = False
    if latter <= 12:
        latter_mm_flag = True

    if former_mm_flag:
        if latter_mm_flag:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if latter_mm_flag:
            print('YYMM')
        else:
            print('NA')

Submission status: Wrong Answer

Solution code:
from itertools import*
from math import*
from collections import*
from heapq import*
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf = 10**18
mod = 10**9+7
from functools import reduce
import sys
sys.setrecursionlimit(10**7)

s = input()
s1 = s[0:2]
s2 = s[2:4]
#どちらかが00になっているとき
if (s1[0]=="0" and s1[1]=="0") or(s2[0]=="0" and s2[1]=="0"):
    print("NA")
else:
    #最初が0Xのとき
    if s1[0]=="0":
        if s2[0]=="0":
            print("AMBIGUOUS")
        else:
            if eval(s2)>12:
                print("MMYY")
            else:
                print("AMBIGUOUS")
    else:
        #最初がYXのかたちY>=1のとき
        if eval(s1)>12:
            if s2[0]=="0" or eval(s2) <= 12:
                print("YYMM")
            else:
                print("NA")
        else:
            if s2[0]=="0":
                print("AMBIGUOUS")
            else:
                if eval(s2)>12:
                    print("MMYY")
                else:
                    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = int(input())
top = S // 100 #上2桁
bottom = S % 100 #下2桁

#flag 1→MMになれる 2:YYになれる(MMになれない)
topFlag = 0
bottomFlag = 0
if 1 <= top and top <= 12:
    topFlag = 1
elif 13 <= top and top <= 99:
    topFlag = 2

if 1 <= bottom and bottom <= 12:
    bottomFlag = 1
elif 13 <= top and top <= 99:
    bottomFlag = 2

#形式の判別
if topFlag == 1 and bottomFlag == 1:
    print("AMBIGUOUS")
elif topFlag == 1 and bottomFlag == 2:
    print("MMYY")
elif topFlag == 2 and bottomFlag == 1:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import re

S = input()
S = [S[i: i+2] for i in range(0, len(S), 2) ]

L, R = int(S[0]), int(S[1])


if  1 <= L <= 12 and 1 <= R <= 12:
  print('AMBIGUOUS')
elif 1 <= L <= 99 and 1 <= R <= 12:
  print('YYMM')
elif 1 <= L <= 12 and 1 <= R <= 99:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input())

if 1 <= a*10+b <= 12 and 1 <= c*10+d <= 12:
  print("AMBIGUOUS")
elif 1 <= a*10+b <= 99 and 1 <= c*10+d <= 12:
  print("YYMM")
elif 1 <= a*10+b <= 12 and 1 <= c*10+d <= 99:
  print("MMYY")
else:
  print("NA")

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")
elif be ==0 and 1<=af<=12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()
#print(s)
m1 = False
m2 = False

s1 = int(s[0:2])
s2 = int(s[2:])
#print(s1, s2)

if 1 <= s1 <= 12:
  m1 = True

if 1 <= s2 <= 12:
  m2 = True

if m1 == True and m2 == True:
  print('ANBIGUOUS')
elif m1 == True and m2 == False:
  print('MMYY')
elif m1 == False and m2 == True:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
s=list(input())
flont=int(s[0]+s[1])
back=int(s[2]+s[3])

if 1<=flont<=12:
    if 1<=back<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
if 1<=back<=12:
    if flont==0 or 13<=flont:
        print("YYMM")
        
if flont==0 or 13<=flont and back==0 or 13<=back:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
lst = [i for i in s]
left = "".join([lst[0], lst[1]])
right = "".join([lst[2], lst[3]])
left = int(left)
right = int(right)
if left > 12:
    if right > 12 or right == 0:
        print("NA")
    elif 0<right <13:
        print("YYMM")
elif 0<left<13:
    if right > 12:
        print("MMYY")
    elif 0<right<13:
        print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq as hq
import itertools as its
import operator as op


# globals
inf = float('inf')
N = 0


def set_inputs():
    global N
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    # ----------MAIN----------
    s = get_str()
    a, b = int(s[:2]), int(s[2:])
    if (a == 0 and (b == 0 or b > 12)) or (b == 0 and (a == 0 or a > 12)) or (a > 12 and b > 12):
        print('NA')
    elif a > 12:
        print('YYMM')
    elif b > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input().strip()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().strip().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# スペース区切りの整数の入力
S = str(input())

front = S[0]+S[1]
rear = S[2]+S[3]

front=int(front)
rear=int(rear)

if front==0 or rear==0 or (front>12 and rear>12):
  print("NA")
elif front<=12 and rear<=12:
  print("AMBIGUOUS")
elif front>12 and rear<=12:
  print("YYMM")
else:
  print("MMYY")

  #YYMM MMは12以下 
  #MMYY MMは12以下
  #AMBIGUOUS 両方とも00を含まない、12以下
  #NA 00を含む、両方とも13以上

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())

#フラグ
yymm = 0
mmyy = 0


if int(s / 100) != 0:
    yymm = yymm + 1
if int(s / 100) <= 12 and int(s / 100) >= 1:
    mmyy = mmyy + 1

if s % 100 != 0:
    mmyy = mmyy + 1
if s % 100 <= 12 and s % 100 >= 1:
    yymm = yymm + 1

if yymm == 2 and mmyy == 2:
    print('AMBIGUOUS')
elif yymm == 2:
    print('YYMM')
elif mmyy == 2:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

s_list = [int(x) for x in list(s)]

a = s_list[0]*10+s_list[1]
b = s_list[2]*10+s_list[3]

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

Submission status: Wrong Answer

Solution code:
S = input()

if S[0:2] == "00" or S[2:4] == "00":
    print("NA")
    
elif S[2:4] > "12" and S[0:2] > "12":
    print("NA")
    
elif S[0:2] > "12" and  S[2:4] <= "12":
    print("YYMM")
    
elif S[2:4] > "12":
    print("MMYY")
    
elif S[0:2] < "12":
    print("AMBIGUOUS")
    
elif S[0:2] == "12" and S[2:4] == "12":
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
mae, usiro = int("".join(S[:2])), int("".join(S[2:]))
if mae <= 12 and usiro <= 12:
    print("AMBIGUOUS")
elif 1 <= mae<= 12 and usiro != 0:
    print("MMYY")
elif mae != 0 and 1 <= usiro <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
try:
    s = input()

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

    if f != 0:
        if b != 0:
            if f > 12:
                print('YYMM')
            else:
                print('AMBIGUOUS')
        else:
            print('NA')
    else:
        print('NA')

except EOFError:
    pass

Submission status: Wrong Answer

Solution code:
S=input()
mozi_1=int(S[0:2])
mozi_2=int(S[2:4])
if 00<mozi_1<13 and 00<mozi_2<13:print("AMBIGUOUS")
elif 0<mozi_1<13 and 00<mozi_2<100:print("MMYY")
elif 0<mozi_2<13 and 00<mozi_1<100:print("YYMM")
else:print("NA")

#print(mozi_1)
#print(mozi_2)

Submission status: Wrong Answer

Solution code:
S = input()
s = list(S)
L = int(s[0] + s[1])
R = int(s[2] + s[3])
if L <= 12:
    if R<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')        
elif R <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

n = str(input())

l = [int(x) for x in list(str(n))]

#存在しない
if l[0]*10 + l[1] > 12 and l[2]*10 + l[3] > 12:
    print("NA")
elif (l[0] + l[1] ==0) or (l[2]+l[3]==0):
    print("NA")
elif l[0]*10 + l[1] <= 12 and l[2]*10 + l[3] <= 12:
    print("AMBIGUOUS")
elif l[0]*10 + l[1] <= 12 and l[2]*10 + l[3] > 12:
    print("MMYY")
elif l[0]*10 + l[1] > 12 and l[2]*10 + l[3] <= 12:
    print("YYMM")
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 s2 > 12:
    print("MMYY")
elif s1 > 12:
    print("YYMM")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

left = moji[0]+moji[1]
right = moji[2]+moji[3]
left = int(left)
right = int(right)

if 0 < left and left < 13:
    if 0 < right and right < 13:
        print("AMBIGUOUS")
    elif 13 <= right:
        print("MMYY")
else:
    if 0 < right and right < 13:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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


def month(n):
    if 0 < n < 13:
        return 0
    else:
        return 1
def year(n):
    if 0< n:
        return 0
    else:
        return 1

if month(s_1) == 0:
    if month(s_2) == 0:
        print("AMBIGUOUS")
    elif year(s_2) == 0:
        print("MMYY")
    else:
        print("NA")
elif year(s_1) == 0:
    if month(s_2) == 0:
        print("YYMM")
    else:
        print("NA")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())
A = S//100
B = S-(A*100)
if B >12:
    if  A > 13:    
        print("YYMM")
    else:
        print("MMYY")
elif 1<= B <=12:
    if A >13:
        print("YYMM")
    else:
        print("AMBIGUOUS")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a,b = int(S[:2]), 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:
S=input()
x=int(S[0:2])
y=int(S[2:4])
if (0<x<13) & (0<y<13): print('AMBIGUOUS')
elif (0<x<13) & (y>13): print('MMYY')
elif (0<y<13) & (x>13): print('YYMM')
else: print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
if (S[:2] == "00") or (S[2:4] == "00"):
  print("{}".format("NA"))
elif ((S[0] == "0") and (S[3] == "0")):
  print("{}".format("AMBIGUOUS"))
elif ((int(S[:2]) < 13) and (int(S[2:4]))):
  print("{}".format("AMBIGUOUS"))
elif(int(S[0]) == 0):
     print("{}".format("MMYY"))
elif(int(S[2]) == 0):
     print("{}".format("YYMM"))
elif((int(S[:2]) > 12) and (int(S[2:4]) > 12)):
  print("{}".format("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 and k>=1:
    if l>=1 and l<=12:
        ans='ANBIGUOUS'
    else:
        ans='YYMM'
elif l>=1 and l<=12:
    ans='MMYY'
else:
    ans='NA'
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
r = 'NA', 'MMYY', 'YYMM', 'AMBIGUOUS'
f = lambda x: 1 <= int(x) <= 12 
print(r[f(s[:2]) + 2 * f(s[3:])])

Submission status: Wrong Answer

Solution code:
S = input()

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

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

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
data = input()

st1 = int(data[0]) * 10 + int(data[1])
st2  = int(data[2]) * 10 + int(data[3])

if (st1<= 12 and st1>=1) and (st2>= 1 and st2 <= 12):
  print("AMBIGUOUS")
elif st1 >= 13 and (st2 != 0 and st2 <= 12):
  print("YYMM")
elif st2 >= 13 and (st1 != 0 and st1 <= 12):
  print("MMYY")
else:
  print("NA")

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 or 10*int(s[0])+int(s[1])>=13:
    print("NA")
  else:
    print("MMYY")
if 10*int(s[0])+int(s[1])>=13:
  if int(s[2])+int(s[3])==0 or 10*int(s[2])+int(s[3])>=13:
    print("NA")
  else:
    print("YYMM")
if 10*int(s[2])+int(s[3])<=12 and 10*int(s[0])+int(s[1])<=12:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = [int(n) for n in s]
a = t[0]*10+t[1]
b = t[2]*10+t[3]
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:
a=input()
i=0
n=[]
while i<len(a):
  n.append(a[i])
  i+=1
pd=n[0]+n[1]
sd=n[2]+n[3]
pd=int(pd)
sd=int(sd)
if pd==0 or sd==0:
  print('NA')
elif pd>12:
  if sd>=1 and sd<=12:
    print('YYMM')
  elif sd>12:
    print('NA')
elif pd<=12:
  if sd>12:
    print ('MMYY')
  elif sd<=12:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s  = input()
a = int(s[:2])
b = int(s[2:])
is_MMxx = is_xxMM = False
if 13 > a > 0:
  is_MMxx = True
if 13 > b > 0:
  is_xxMM = True
if is_MMxx and is_xxMM:
  print("AMBIGUOUS")
elif is_MMxx:
  print("MMYY")
elif is_xxMM:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
S = input()
first = int(S[0:2])
second = int(S[2:4])
first_YY,first_MM = 1,0
second_YY,second_MM = 1,0
if first > 0 and first <= 12:
	if second > 0 and second <= 12:
		print("AMBIGUOUS")
	else:
		print("MMYY")
elif (first == 0 and second >12) or (first > 12 and second ==0):
	print("NA")
elif second > 0 and second <= 12:
	print("YYMM")

Submission status: Wrong Answer

Solution code:
S = input()

YY = int(S[0]) * 10 + int(S[1])
MM = int(S[2]) * 10 + int(S[3])

if YY == 0 or MM == 0:
  print("NA")
  exit(0)

if MM > 12:
  print("YYMM")
elif YY > 12:
  print("MMYY")
else:
  print("AMBIGUOUS")

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[2]+s[3]) <= 12:
    print("YYMM")
elif int(s[0]+s[1]) <= 12:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
S = input()

if int(S[0:2])>12 or int(S[0:2])==0:
    if int(S[2:4])<=12 or int(S[2:4])!=0:
        print('YYMM')
    else:
        print('NA')
else:
    if int(S[2:4])<=12 or int(S[2:4])==0:
        print('AMBIGUOUS')
    else:
        print('MMYY')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect
import math
def solve():
  s = int(input())
  if s//100 == 0 and s%100 == 0:
    print("NA")
    exit()
  
  if s//100 != 0 and s//100 <= 12:
    tp = s%100
    if 1<= tp and tp <= 12:
      print("AMBIGIOUS")
    elif tp == 0:
      print("MMYY")
    elif 13 <= tp and tp <= 99:
      print("MMYY")
    else:
      print("NA")
  else:
    tp = s%100
    if 1<= tp and tp <= 12:
      print("YYMM")
    else:
      print("NA")
solve()

Submission status: Wrong Answer

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

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

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

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


status = ""

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

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

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

Submission status: Wrong Answer

Solution code:
x = list(input())

if int(x[0]) == 0 and int(x[1]) == 0 and int(x[2]) > 0:
    print('NA')
elif int(x[2]) == 0 and int(x[3]) == 0 and int(x[0]) > 0:
    print('NA')
elif int(x[0]) >= 1 and int(x[1]) > 2:
    if int(x[2]) >= 1 and int(x[3]) > 2:
        print('NA')
    else:
        print('YYMM')
elif int(x[2]) >= 1 and int(x[3]) > 2:
    if int(x[0]) >= 1 and int(x[1]) > 2:
        printf("NA")
    else:
        print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:

S = int(input())

before = S % 100
after = S //100

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

Submission status: Wrong Answer

Solution code:

S = list(input())

front = int(S[0]+S[1])
rear = int(S[2]+S[3])


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

Submission status: Wrong Answer

Solution code:
S = int(input())
A = S//100
B = S-(A*100)
if B >12:
    if  A > 13:    
        print("YYMM")
    elif A <=12:
        print("MMYY")
elif 1<= B <=12:
    if A >13:
        print("YYMM")
    elif A <=12:
        print("AMBIGUOUS")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
h=int((S[:2]))
f=int((S[2:]))

hn = 0
fn = 0

if 12 >= h and h > 0:
    hn = 2
elif h > 0:
    hn = 1

if 12 >= f and f > 0:
    fn = 2
elif f > 0:
    fn = 1

if hn == 2 and fn == 2:
    print("AMBIGUOUS")

elif hn == 2 and fn == 1:
    print("MMYY")

elif fn == 2 and hn == 1:
    print("YYMM")

else:
    print("NA")

Submission status: Wrong Answer

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

left = moji[0]+moji[1]
right = moji[2]+moji[3]
left = int(left)
right = int(right)

if 0 < left and left < 13:
    if 0 < right and right < 13:
        print("AMBIGIOUS")
    elif 13 <= right:
        print("MMYY")
else:
    if 0 < right and right < 13:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
from itertools import*
from math import*
from collections import*
from heapq import*
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf = 10**18
mod = 10**9+7
from functools import reduce
import sys
sys.setrecursionlimit(10**7)

s = input()
s1 = s[0:2]
s2 = s[2:4]
#どちらかが00になっているとき
if (s1[0]=="0" and s1[1]=="0") or(s2[0]=="0" and s2[1]=="0"):
    print("NA")
else:
    #最初が0Xのとき
    if s1[0]=="0":
        if s2[0]=="0":
            print("AMBIGUOUS")
        else:
            if int(s2[1])>2:
                print("MMYY")
            else:
                print("AMBIGUOUS")
    else:
        #最初がYXのかたちY>=1のとき
        if eval(s1)>12:
            if s2[0]=="0" or eval(s2) < 12:
                print("YYMM")
            else:
                print("NA")
        else:
            if s2[0]=="0":
                print("AMBIGUOUS")
            else:
                if eval(s2)>12:
                    print("MMYY")
                else:
                    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = str(input())
s_a = s[:2]
s_b = s[2:]
def cale(t):
  result_list = []
  if int(t) > 0 and int(t) < 13:
    result_list.append('MM')
  elif int(t) > 0 and int(t) <100:
    result_list.append('YY')
  else:
    result_list.append('NA')
  return result_list

s_a_re = cale(s_a)
s_b_re = cale(s_b)

if s_a_re[0] in 'NA' or s_b_re[0] in 'NA':
  print('NA')
elif s_a_re[0] == s_b_re[0]:
  print('AMBIGUOUS')
else:
  aws = s_a_re[0] + s_b_re[0]
  print(aws)

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[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)) and (ls[0]<2 or ls[2]<2):
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())
a = S // 100
b = S % 100
if (a == 0 and b == 0) or (12 < a and 12 < b):
  print("NA")
elif 0 < a < 13 and 0 < b < 13:
  print("AMBIGUOUS")
elif 0 < a < 13 and b != 0:
  print("MMYY")
elif 0 < b < 13 and a != 0:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

a = False
b = False

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

if int(s[2:4]) <= 12:
    b = True

if int(s[0:2]) == 0 or int(s[3:5]) == 0 or(not a and not b):
    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:
S=input()

left=int(S[:2])
right=int(S[2:])

if left==0:
  YYMM=True
  MMYY=False
  AMBIGUOUS=False
  NA=True
elif left>12:
  YYMM=True
  MMYY=False
  AMBIGUOUS=False
  NA=True
else:
  YYMM=True
  MMYY=True
  AMBIGUOUS=True
  NA=False
  
if right==0:
  YYMM=False
  AMBIGUOUS=False
elif left>12:
  MMYY=False
  AMBIGUOUS=False
else:
  YYMM=True
  AMBIGUOUS=True

if YYMM==True:
  if MMYY==True:
    print("AMBIGOUS")
  else:
    print("YYMM")
elif MMYY==True:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())

left =  ''.join(S[0:2])
right = ''.join(S[2:4])


left_flag = 0
right_flag = 0
if int(left) <= 12 and left != '00':
    left_flag = 1

if int(right) <= 12 and right != '00':
    right_flag = 1


if left_flag == 1 and right_flag == 0:
    print('MMYY')
elif left_flag == 1 and right_flag == 1:
    print('Ambiguous')
elif left_flag == 0 and right_flag == 1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

a = s[0:2]
b = s[2:4]

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

if S[0:2] == "00" or S[2:4] == "00":
    print("NA")
    
elif S[2:4] > "12" and S[0:2] > "12":
    print("NA")
    
elif S[0:2] > "12" and  S[2:4] <= "12":
    print("YYMM")
    
elif S[2:4] > "12":
    print("MMYY")
    
elif S[0:2] < "12":
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
s = list(S)
L = int(s[0] + s[1])
R = int(s[2] + s[3])
if L < 12 and R<12:
    print('AMBIGUOUS')
elif R < 12:
    print('YYMM')
elif L<12:
    print('MMYY')
else:
    print('NA')