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:
ans = ''
fmt = input()
n1 = int(fmt[:2])
n2 = int(fmt[2:])

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

Submission status: Wrong Answer

Solution code:
S = input()

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

print(a, b)

isYYMM = 1 <= b <= 12
isMMYY = 1 <= a <= 12

if isYYMM and isMMYY:
    print('NA')
elif isYYMM:
    print('YYMM')
elif isMMYY:
    print('MMYY')
else:
    print('AMBIGUOUS')

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")
elif left == 0:
    if 0 < right < 13:
        print("YYMM")
    elif right == 0 or right >12:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())
a = S // 100
b = S % 100

ans = ""

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

print(ans)

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")
     
elif S[0:2] == "12" and S[2:4] == "12":
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
if ((S[:2] == "00") or (S[2:4]) == "00"):
  print("{}".format("NA"))
elif (S[:2] == "00") and (int(S[2:4]) < 13):
  print("{}".format("YYMM"))
elif(int(S[:2]) < 13) and (S[2:4] == "00"):
  print("{}".format("MMYY"))
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 = input()
a = int(S[0:2])
b = int(S[2:4])

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

Submission status: Wrong Answer

Solution code:
s = int(input())

s1 = s // 100
s2 = s - s1

if s1 > 12 or s1 == 0:
    temp1 = 0
else:
    temp1 = 1

if s2 > 12 or s2 == 0:
    temp2 = 0
else:
    temp2 = 1


if temp1 == 0 and temp2 == 1:
    print("YYMM")
if temp1 == 0 and temp2 == 0:
    print("NA")
if temp1 == 1 and temp2 == 0:
    print("MMYY")
if temp1 == 1 and temp2 == 1:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
print("MMYY")

Submission status: Wrong Answer

Solution code:
s = list(input())
m = ['{:02}'.format(n) for n in range(1,13)]
f = ''.join(s[:2])
b = ''.join(s[2:])

if f == '00' or b == '00':
    print('NA')
elif f in m and b in m:
    print('AMBIGUOUS')
elif f in m and b not in m:
    print('MMYY')
elif f not in m and b in m:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
import re 
S=input()
def YM(S):
  if re.match("(1[3-9]|[2-9][0-9])(0[1-9]|1[0-2])",S):
    print("YYMM")
  elif re.match("(0[1-9]|1[0-2])(1[3-9]|[2-9][0-9])",S):
    print("MMYY")
  else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
import sys


def main():
    S = sys.stdin.readline().rstrip()

    s1, s2 = int(S[:2]), int(S[2:])
    if s1 < 1 or s2 < 1:
        print("NA")

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

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


if __name__ == "__main__":
    main()

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[2:4]) == 0 or(not a and not b):
    print('NA')
    exit()

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

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

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

Submission status: Wrong Answer

Solution code:
S=str(input())
F=S[0:2]
R=S[2:4]
if(int(F)<=12 and F!="00" and int(R)<=12 and R!="00"):
    print("ANBIGUOUS")
elif(int(F)<=12 and F!="00" and (int(R)>12 or R=="00")):
    print("MMYY")
elif((int(R)<=12 and R!="00" and (int(F)>12 or F=="00"))):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()

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

YYMM=True
MMYY=True
AMBIGUOUS=True
NA=True


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

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

Submission status: Wrong Answer

Solution code:
S = input()
if int(S[0]+S[1])>12:
    if int(S[2]+S[3])>12:
        print("NA")
    if int(S[2]+S[3])== 0:
        print("NA")
    else:
        print("YYMM")
elif 12>=int(S[0]+S[1])>0:
    if int(S[2]+S[3])>12:
        print("MMYY")
    if int(S[2]+S[3]) == 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")
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 >= 0 and 0 < b <= 12:
    print("YYMM")
elif b >= 0 and 0 <= a <= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

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

YM=MY=False
if A and 0<B<=12: YM=True
if 0<A<=12 and B: MY=True

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = int(input())

before = S % 100
after = S //100

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

Submission status: Wrong Answer

Solution code:
s = input()
front = int(s[:2])
back = int(s[2:])

f_bool = front <13
b_bool = back <13

if f_bool ^ b_bool:
    if f_bool:
        print("MMYY")
    
    else:
        print("YYMM")
elif f_bool:
    print("AMBIGOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
def judge_format(text):
    former, latter = int(text[:2]), int(text[2:])
    if 1 <= former <= 12 and latter == 0 or latter > 12:
        return 'MMYY'
    elif 1 <= latter <= 12 and former == 0 or former > 12:
        return 'YYMM'
    elif 1 <= former <= 12 and 1 <= latter <= 12:
        return 'AMBIGUOUS'
    else:
        return 'NA'
    

def main():
    s = input()
    print(judge_format(s))


main()

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]


# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}
# b = list(map(lambda x: math.ceil(x/10)*10, a))

s = int(input())
YY = s // 100
MM = s % 100
print(YY, MM)
if 1 <= YY <= 12 and 1 <= MM <= 12 or 1 <= YY <= 12 and 1 <= MM <= 12:
    print("AMBIGUOUS")
elif 0 < MM <= 12:
    print("YYMM")
elif 0 < YY <= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
#coding: utf-8
S = input()
year = 99
month = 12
mae = int(S[2:])
ushiro = int(S[2:])
#mae, ushiro = int(S[:2]), int(S[2:])
if 0 < mae <= month and 0 < ushiro <= month:
    print("AMBIGUOUS")
elif 0 < mae <= month and month < ushiro <= year:
	print("MMYY")
elif month < mae <= year and 0 < ushiro <= month:
	print("YYMM")
else:
	print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

def main():
	dp =input()
	mae = int(dp[0])*10 + int(dp[1])
	ushiro = int(dp[2])*10 + int(dp[3])
	if 1 <= mae <= 12 and  ushiro <= 12:
		print("AMBIGUOUS")
	elif 1 <= mae <= 12 and  ushiro > 12:
		print("MMYY")
	elif mae > 12 and  1 <= ushiro <= 12:
		print("YYMM")
	else:
		print("NA")   
main()

Submission status: Wrong Answer

Solution code:
S = list(input())
S1 = int("".join(S[0:2]))
S2 = int("".join(S[2:4]))
 
if (12 >= S1 and S1 >= 1) and (12 >= S2 and S2 >= 1):
  print('AMBIGUOUS')
elif (12 >= S1 and S1 >= 1) and (S2 != 0):
  print('MMYY')
elif (12 >= S2 and S2 >= 2) and (S1 != 0):
  print('YYMM')
else :
  print('NA')

Submission status: Wrong Answer

Solution code:
s=str(input())

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

Submission status: Wrong Answer

Solution code:
s=input()
former,latter=int(s[:2]),int(s[2:])

#0,13<=x<=99で年だけ　1<=x<=12で年か月,　ほかはどっちか
def decide(x):
    if x==0 or 13<=x<=99:
        return 0  #年だけ
    elif 1<=x<=12:
        return 1  #どっちもある
f=decide(former)
l=decide(latter)

if f==0 and l==1:
    print('YYMM')
elif f==1 and f==0:
    print('MMYY')
elif f==0 and l==0:
    print('NA')
else:
    print('AMBIGUOUS')

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")
elif left == 0:
    if 0 < right < 13:
        print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=str(input())

first=s[0]+s[1]
last=s[2]+s[3]
first=int(first)
last=int(last)

if (last and first)<13 and (last and first)>0:
    print("AMBIGUOUS")
    
elif (last==0 or first==0) and (last>12 or first>12) :
    print("NA")

elif last>12 and first>12:
    print("NA")
elif last==0 and first==0:
    print("NA")

elif (first>12 or first==0) and (last<13 and last>0) :
    print("YYMM")

elif (last>12 or last==0) and (first<13 and first>0) :
    print("MMYY")

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

Submission status: Wrong Answer

Solution code:
S=input()

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

if F==0 or F>12 and A==0 or 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 = input()
if (S[:2] == "00") and (int(S[2:4]) < 13):
  print("{}".format("YYMM"))
elif(int(S[:2]) < 13) and (S[2:4] == "00"):
  print("{}".format("MMYY"))
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())

ue2keta = S // 100
shita2keta = S % 100

if (0 < ue2keta < 13) & (shita2keta == 0) | (shita2keta > 12):
    print("MMYY")
elif (0 < shita2keta < 13) & (ue2keta == 0) | (ue2keta > 12):
    print("YYMM")
elif (0 < ue2keta < 13) & (0 < shita2keta < 13):
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())
ans = "NA"
up2 = (S // 100) % 100
du2 = S % 100

if 0 < up2 < 13 and 0 < du2 < 13:
    ans = "AMBIGUOUS"
elif up2 > 13 and 0 < du2 < 13:
    ans = "YYMM"
elif du2 > 13 and 0 < up2 < 13:
    ans = "MMYY"
elif du2 == 0 and 0 < up2 < 13:
    ans = "MMYY"
elif up2 == 0 and 0 < du2 < 13:
    ans = "YYMM"
else:
    ans = "NA"

print(ans)

Submission status: Wrong Answer

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

# Your code here!
 
X = [x for x in input()]
A = int(''.join(X[:2]))
B = int(''.join(X[2:]))

def is_month(n):
    if 0 < n and n <= 12:
        return True
    return False
    
def is_year(n):
    if 0 < n:
        return True
    return False
 
if is_month(A) and is_month(B):
    print('AMBIGUOUS')
elif is_month(A) and is_year(B):
    print('MMYY')
elif is_year(A) and is_month(B):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()

if s[:2] == "00":
    print("NA")
    
elif s[2:] == "00":
    print("NA")
    
elif int(s[2:]) > 12:
    if int(s[:2]) <13:
        print("MMYY")
        
elif int(s[2:]) < 12:
        print("YYMM")

else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
Y=input()#1行に沢山の数値(または文字)が並んでいる場合にリストに格納していく
X=[]
X=list(Y) #文字列（単語）または数列を1文字ずつに分解

A=[]
A.append(X[0])
A.append(X[1])
a=''.join(A)
a=int(a)

B=[]
B.append(X[2])
B.append(X[3])
b=''.join(B)
b=int(b)


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

elif b==0 and 1<=a<=12:
    print('MMYY')
elif b==0 and 13<=a<=99:
    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 > 12:
    hn = 1

if 12 >= f and f > 0:
    fn = 2
elif f > 12:
    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()
SL = int(S[0:2])
SR = int(S[2:4])

if SL <= 12:
    if SR<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif SR<=12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
strs = input()
lista = []
for i in strs:
    lista.append(i)
ab = int(lista[2]) *10 + int(lista[3])
cd = int(lista[0]) *10 + int(lista[1])
if ab > 12  and 0 < cd <= 12:
    print("MMYY")
elif 0 < ab <= 12 and cd >12:
    print("YYMM")
elif 0 < ab <= 12 and 0 < cd <= 12:
    print("AMBIGUOUS")
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 = str(input())

S_1 = int(S[:2])
S_2 = int(S[2:])

if (S_1 <=12) and (S_2 <= 12) and (S_1 != 0) and (S_2 != 0):
    print('AMBIGUOUS')
elif (S_1 <= 12) and (S_2 > 12) and (S_1 != 0) and (S_2 != 0):
    print('MMYY')
elif (S_1 > 12) and (S_2 <= 12) and (S_1 != 0) and (S_2 != 0):
    print('YYMM')
elif (S_1 > 12) and (S_2 > 12) and (S_1 != 0) and (S_2 != 0):
    print('NA')
elif (S_1 == 0) or (S_2 == 0):
    print('NA')

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('UMBIGUOUS')
    else:
        print('MMYY')
else:
    if(1 <= usiro <= 12):
        print('YYMM')
    else:
        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 and n2 > 12:
    ans = 'AMBIGUOUS'
elif n1 > 12:
    ans = 'YYMM'
else:
    ans = 'MMYY'
print(ans)

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) or top == 0:
    topFlag = 2

if 1 <= bottom and bottom <= 12:
    bottomFlag = 1
elif (13 <= top and top <= 99) or top == 0:
    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:
s=[int(i) for i in list(input())]

if (s[0]==0 or (s[0]==1 and (s[1]==0 or s[1]==1 or s[1]==2))) and (s[2]==0 or (s[2]==1 and (s[3]==0 or s[3]==1 or s[3]==2))):
    print('ANBIGUOUS')
elif s[0]==0:
    print('MMYY')
elif s[0]==1 and (s[1]==0 or s[1]==1 or s[1]==2):
    print('MMYY')
elif s[2]==0:
    print('YYMM')
elif s[2]==1 and (s[3]==0 or s[3]==1 or s[3]==2):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
if (s[2] == "0" and (s[3] == "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9")) or (s[2] == "1" and s[3] == "0" or "1" or "2"):
    if (s[0] == "0" and (s[1] == "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9")) or (s[0] == "1" and s[1] == "0" or "1" or "2"):
        print("MMYY")
    else:
        print("NA")
else:
    if (s[0] == "0" and (s[1] == "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9")) or (s[0] == "1" and s[1] == "0" or "1" or "2"):
        print("AMBIGUOUS")
    else:
        print("YYMM")

Submission status: Wrong Answer

Solution code:
s=input()

l=int(s[:2])
r=int(s[2:4])

ans=""

if l<=12 and l>=1:
  if r<=12 and r>=1:
    ans="AMBIGUOUS"
  else:
    ans="MMYY"
if r<=12 and r>=1:
  if l<=12 and l>=1:
  	ans="AMBIGUOUS"
  else:
  	ans="YYMM"
if r>12 and r<1 and l>12 and l<1:
    ans="NA"
print(ans)

Submission status: Wrong Answer

Solution code:
S=str(input())
s=list(S)
# print(S[0:2])
# print(S[3:4])
s1 = int(''.join(S[0:2]))
s2 = int(''.join(S[3:4]))


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

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[:2])
b=int(s[2:])
if 0==a or 0==b:
    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 0<b:
    print("MMYY")
elif 0<b<=12 and 0<a:
    print("YYMM")

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 len(l)!=4:
    print("NA")
elif 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 = list(str(input()))

if int(s[0]+s[1]) == 0 or int(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:
# -*- 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")
elif be == 0 and af == 0:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S=list(input())
XXYY=[]
l=' '
for i in range(2):
    l+=S[i]
XXYY.append(int(l))
l=' '
for i in range(2,4):
    l+=S[i]
XXYY.append(int(l))
ans=[]
if XXYY[0]>31:
    ans.append("NA")
elif XXYY[0]<=31 and XXYY[0]>12:
    if XXYY[1]<=12 and XXYY[1]>0:
        ans.append("MMYY")
    else:
        ans.append("NA")
elif XXYY[0]<=12 and XXYY[0]>0:
    if XXYY[1]<=31 and XXYY[1]>12:
        ans.append("YYMM")
    elif XXYY[1]<=12 and XXYY[1]>0:
        ans.append("AMBIGUOUS")
    else:
        ans.append("NA")
else:
     ans.append("NA")
print(ans[0])

Submission status: Wrong Answer

Solution code:
import sys

s = input()

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

if (int(a) > 12 and int(b) > 12) or  int(b) == 0  or int(a) == 0:
	
	print("NA")
	sys.exit()
	
if int(a) > 12 and int(b) <= 12:

	print("YYMM")
	sys.exit()

if int(a) <= 12 and int(b) > 12:

	print("MMYY")
	sys.exit()
		

print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

def main():
	dp =input()
	mae = int(dp[0])*10 + int(dp[1])
	ushiro = int(dp[2])*10 + int(dp[3])
	if mae <= 12 and  ushiro <= 12:
		print("AMBIGUOUS")
	elif mae <= 12 and  ushiro > 12:
		print("MMYY")
	elif mae > 12 and  ushiro <= 12:
		print("YYMM")
	else:
		print("NA")   
main()

Submission status: Wrong Answer

Solution code:
s = input()

#YYMM
if (int(s[:2]) >= 13 or int(s[:2]) == 0) and (int(s[2:]) >= 1 and int(s[2:]) <= 12):
      print("YYMM")
elif (int(s[2:]) >= 1 and int(s[2:]) <= 12) and (int(s[:2]) >= 1 and int(s[:2]) <= 12):
      print("AMBIGUOUS")
elif (int(s[:2]) >= 1 and int(s[:2]) <= 12) and ((int(s[:2]) >= 13 or int(s[:2]) == 0)):
      print("MMYY")
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<=s2<=99 and 1<=s1<=12):
    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("AMBIGUOUS")
    
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()

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('MMYY')
    exit()

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

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) == 0 and int(b) == 0:
    print("NA")
elif int(a) > 12:
    print("YYMM")
elif int(b) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
i = list(input())
yy = int(i[0] + i[1])
mm = int(i[2] + i[3])
print(yy, mm)

if (yy > 12) and (0 < mm <= 12):
    print("YYMM")
elif (0 < yy <= 12) and (mm > 12):
    print("MMYY")
elif (0 < yy <= 12) and (0 < mm <= 12):
    print("AMBIGUOUS")
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")
elif be == af == 0:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
sl = list(map(int, [s[0:2],s[2:]]))
f,l = sl[0], sl[1]
if (f ==0 and (l ==0 or l >12)) or (l ==0 and (f==0 or f>12)) :
    print('NA')
elif  f < 13 and l <13:
    print('AMBIGOOUS')
elif f >12 and l <13:
    print('YYMM')
elif f<13 and l>12:
    print('MMYY')
else :
    print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
mm=['01','02','03','04','05','06','07','08','09','10','11','12']
yy=['00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19']

if S[0:2] in mm:
    if S[2:4] in mm:
        print('AMBIGUOUS')
    elif S[2:4] in yy:
        print('MMYY')
    else:
        print('NA')
elif S[0:2] in yy:
    if S[2:4] in mm:
        print('YYMM')
    else:
        print('NA')
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 and int(back) != 0:
    yymm_flag = True
  elif int(back) == 0:
    yymm_flag = False
    mmyy_flag = False
elif int(fore) <= 12 and int(fore) != 0:
  yymm_flag = False
  mmyy_flag = True
  if int(back) > 12:
    mmyy_flag = True
  elif int(back) <= 12:
    yymm_flag = True
elif int(fore) == 0:
  if int(back) > 12:
    yymm_flag = False
    mmyy_flag = False
  elif int(back) <= 12 and int(back) != 0:
    yymm_flag = True
  elif int(back) == 0:
    yymm_flag = 0
    mmyy_flag = 0
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:
S = input()
if (int(S[0:2]) <= 12) and (int(S[0:2]) > 0):
    if int(S[2:4]) <= 12:
        if int(S[2:4]) > 0:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        print('MMYY')
else:
    if (int(S[2:4]) <= 12) and (int(S[2:4]) > 0):
        print('YYMM')
    else:
        if (int(S[0:2]) == 0) and (int(S[2:4]) <= 12):
            print('YYMM')
        else:
            print('NA')

Submission status: Wrong Answer

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

def year_chack(s):
    return True

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

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


status = ""

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

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

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

Submission status: Wrong Answer

Solution code:
target = input()
first, second = int(target[0:2]), int(target[2:4])

def check():
  if first == 0 or second == 0:
    return 'NA'
  elif first >12 and second >12:
    return 'NA'
  elif first <= 12 and second <= 12:
    return 'AMBIGUOUS'
  elif first >12 and second <= 12:
    return 'YYMM'
  else:
    return 'MMYY'

if __name__ == '__main__':
  print(check())

Submission status: Wrong Answer

Solution code:
S=str(input())
F=S[0:2]
R=S[2:4]
if(int(F)<=12 and F!="00" and int(R)<=12 and R!="00"):
    print("ANBIGUOUS")
elif(int(F)<=12 and F!="00" and int(R)>12):
    print("MMYY")
elif((int(R)<=12 and R!="00" and int(F)>12)):
  print("YYMM")
else:
  print("NA")