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:
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
if 0 <= YY <= 12 and 1 <= MM <= 12 or 1 <= YY <= 12 and 0 <= MM <= 12:
    print("AMBIGUOUS")
elif 13 <= YY and 0 < MM <= 12:
    print("YYMM")
elif 13 <= MM and 0 < YY <= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()


str12=int(S[0:2])
str34=int(S[2:4])

str12_enableMM = False
if 1 <= str12 and str12 <= 12:
    str12_enableMM = True

str34_enableMM = False
if 1 <= str34 and str34 <= 12:
    str34_enableMM = True



ans="NA"

# YYMM or YYYY
if str12_enableMM is False:
    if str34_enableMM is True:
        ans = "YYMM"
    else:
        #YYYY
        pass
# YYMM or MMYY or MMMM
else:
    if str34 == 0:
        # MMYY
        pass
    elif str34_enableMM is True:
        ans = "AMBIGUOUS"
    else:
        # MMYY
        ans = "MMYY"

print(ans)

Submission status: Wrong Answer

Solution code:
A = list(int(i) for i in str(input()))
A, B = A[0]*10+A[1], A[2]*10+A[3]
if A == 0:
    if B == 0 and B>12:
        print("NA")
    else:
        print("YYMM")
elif A <= 12:
    if 0 < B and B <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 0 < B and B <= 12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
if (s[0] == "0" and s[1] != "0") or (s[0] == "1" and s[1] == "0") or (s[0] == "1" and s[1] == "1") or (s[0] == "1" and s[1] == "2"):
  if s[2] == "0" or (s[2] == "1" and s[3] == "0") or (s[2] == "1" and s[3] == "1") or (s[2] == "1" and s[3] == "2"):
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if (s[2] == "0" and s[3] != "0") or (s[2] == "1" and s[3] == "0") or (s[2] == "1" and s[3] == "1") or (s[2] == "1" and s[3] == "2"):
    print("YYMM")
  else:
    print("NA")

Submission status: Wrong Answer

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

S=list(str(input()))
S1=int("".join(S[0:2]))
S2=int("".join(S[2:4]))

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

Submission status: Wrong Answer

Solution code:
N = int(input())

fst = int(N/100)
sec = N - fst*100

f_YY = False
s_YY = False
f_MM = False
s_MM = False

if 0 <= fst and fst <= 99:
    f_YY = True
if 0 <= sec and sec <= 99:
    s_YY = True
    
if 1 <= fst and fst <= 12:
    f_MM = True
if 1 <= sec and sec <= 12:
    s_MM = True
    
if (f_YY == True and s_MM == True) and\
    (f_MM == True and s_YY == True):
    print('AMBIGUOUS')
elif f_YY == True and s_MM == True:
    print('YYMM')
elif f_MM == True and s_YY == True:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
a=int(input())
y=a//100
m=a%100
if m>12 and y==0 or m==0 and y>12:
    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 = input()
num_be = int(S[:2])
num_af = int(S[2:])

if ( ((num_be > 12) & (num_af > 12)) or num_be == 0 or num_af == 0):
  print('NA')
elif ( ((num_be > 0) & (num_be < 13)) & ((num_af > 0) & (num_af < 13)) ):
  print('AMBIGUOUS')
elif(num_be > 12):
  print('YYMM')
else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:

s = input()

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

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

Submission status: Wrong Answer

Solution code:
s = input()

mae = s[:2]
usiro = s[2:]

flag = 'NA'

if 1 <= int(mae) <= 12 and int(usiro) > 12:
    flag = 'MMYY'
if 1 <= int(usiro) <= 12 and int(mae) > 12:
    flag = 'YYMM'
if 1 <= int(mae) <= 12 and 1 <= int(usiro) <= 12:
    flag = 'AMBIGUOUS'

print(flag)

Submission status: Wrong Answer

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

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

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

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:
N = int(input())

fst = int(N/100)
sec = N - fst*100

f_YY = False
s_YY = False
f_MM = False
s_MM = False

if 0 <= fst and fst <= 99:
    f_YY = True
if 0 <= sec and sec <= 99:
    s_YY = True
    
if 1 <= fst and fst <= 12:
    f_MM = True
if 1 <= sec and sec <= 12:
    s_MM = True
        
print(f_YY,s_YY,f_MM,s_MM)
    
if (f_YY == True and s_MM == True) and\
    (f_MM == True and s_YY == True):
    print('AMBIGUOUS')
elif f_YY == True and s_MM == True:
    print('YYMM')
elif f_MM == True and s_YY == True:
    print('YYMM')
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>0 and a<=12 and b>=1 and b<=12:
    print("AMBIGUOUS")
elif a>12 and b>0 and b<=12:
    print("YYMM")
elif a<=12 and a>0 and b>12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S=input()

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

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

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")
else:
  print("AMBIGUOUS")

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()
ans=''
if 0<int(s[:2])<=12 and 0<int(s[2:])<=12:
  ans='AMBIGUOUS'
elif int(s[:2])>12 or int(s[:2])==0 and 0<int(s[2:])<=12:
  ans='YYMM'
elif 0<int(s[:2])<=12 and int(s[2:])>12 or int(s[2:])==0:
  ans='MMYY'
else:
  ans='NA'
print(ans)

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])
# 文字列の入力
print f
if(f == 0):
    if(l == 0):
        ans = "NA"
    if(l > 0 and 13> l):
        ans = "YYMM"
    if(l >= 13):
        ans= "NA"
elif(f > 0 and 13 > f):
    if(l == 0):
        ans = "MMYY"
    if(l > 0 and 13 > l):
        ans = "AMBIGUOUS"
    if(l >= 13):
        ans= "MMYY"
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:
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:
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 0 <= int(S[2:]) <= 12:
        print('AMBIGUOUS')
    elif 13 <= int(S[2:]):
        print('MMYY')
    elif int(S[2:]) == 0:
        print('MMYY')
    else:
        print('NA')
elif int(S[:2]) == 0:
    if 0 <= int(S[2:]) <= 12:
        print('YYMM')
    else:
        print('NA')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
a = input()
q, mod =divmod(int(a), 100)
if q == 0 :
  if mod < 13 and mod != 0:
    print("YYMM")
  else : print("NA")
elif mod == 0 :
  if q < 13 and q != 0:
    print("YYMM")
  else : 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:
def isY(num):
    if num == 0:
        return False

    return True

def isM(num):
    if num <= 12 and num >= 1:
        return True

    return False


line = input()
first = int(line[:2])
second = int(line[2:])

ans = "NA"

if isY(first) and isM(second):
    ans = "YYMM"

if isM(first) and isY(second):
    if ans == "YYMM":
        ans = "AMBIGUOUS"
    else:
        ans = "MMYY"



    
if (first == 00) or (second == 00):
    ans = "NA"
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()


def ismm(s):
    pat = [i+1 for i in range(12)]
    if int(s) in pat:
        return True
    else:
        return False
s1 = S[0:2]
s2 = S[2:4]
if s1 == '00' or s2 == '00':
    print('NA')
    exit(0)
if ismm(s1):
    if ismm(s2):
        #両方MM
        print('AMBIGUOUS')
    else :
        #前だけMM
        print('MMYY')
else:
    if ismm(s2):
        #後ろだけMM
        print('YYMM')
    else :
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
if len(S) != 4:
  print("{}".format("NA"))
elif (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"))

Submission status: Wrong Answer

Solution code:
s=input()

yy=int(s[:2])
mm=int(s[2:])

if yy - mm >= 12 and mm != 0:
    print('YYMM')
elif yy - mm <= -12 and yy != 0:
    print('MMYY')
elif yy - mm >= -12 and yy -mm <= 12 and yy != 0 and mm != 0:
    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:
  print("YYMM")
elif st2 >= 13 and st1 != 0:
  print("MMYY")
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) or (int(S[2]) >= 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())
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")
elif a>12 and b>12:
    print("NA")
elif a==0 and b==0:
    print("NA")
elif a==0 and b>12:
    print("NA")
elif a>12 and b==0:
    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()
if s1 > 0 and s1 <= 12:
    if s2 > 0 and s2 <= 12:
        print('AMBIGUOUS')
        exit()
    if s2 > 0:
        print('MMYY')
        exit()
print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
N = int(input())

first = int(N/100)
second = N - first*100

f_YY = False
s_YY = False
f_MM = False
s_MM = False

if 0 <= first and first <= 99:
    f_YY = True
if 0 <= second and second <= 99:
    s_YY = True
    
if 1 <= first and first <= 12:
    f_MM = True
if 1 <= second and second <= 12:
    s_MM = True
        
print(f_YY,s_YY,f_MM,s_MM)
    
if (f_YY == True and s_MM == True) and\
    (f_MM == True and s_YY == True):
    print('AMBIGUOUS')
elif f_YY == True and s_MM == True:
    print('YYMM')
elif f_MM == True and s_YY == True:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

bs = int(s[:2])
cs = int(s[2:])

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

S = int(input())
#print(S)

YYMM_flag = 0
MMYY_flag = 0

former = math.floor(S / 1000) * 10
S = S % 1000
former += math.floor(S / 100)
#print(former)
S = S % 100
latter = S
#print(latter)

if(1 <= former and former <= 12):
    if(latter > 0):
        MMYY_flag = 1

if(1 <= latter and latter <= 12):
    if(former > 0):
        YYMM_flag = 1

if(YYMM_flag == 1):
    if(MMYY_flag == 1):
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    if(MMYY_flag == 1):
        print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s=input()

if s[0:2]=="01" or s[0:2]=="02" or s[0:2]=="03" or s[0:2]=="04" or s[0:2]=="05" or s[0:2]=="06" or s[0:2]=="07" or s[0:2]=="08" or s[0:2]=="09" or s[0:2]=="10" or s[0:2]=="11" or s[0:2]=="12":
    print("AMBIGUOUS")
else:
    if s[2:4]=="01" or s[2:4]=="02" or s[2:4]=="03" or s[2:4]=="04" or s[2:4]=="05" or s[2:4]=="06" or s[2:4]=="07" or s[2:4]=="08" or s[2:4]=="09" or s[2:4]=="10" or s[2:4]=="11" or s[2:4]=="12":
        print("YYMM")
    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:
def m(ss):
    if ss > 0 and ss <= 12:
        return 1
    return 0

s = list(input())
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
print(s1,s2)
if m(s1) and m(s2):
    print("AMBIGUOUS")
elif m(s1) and not(m(s2)):
    print("MMYY")
elif not(m(s1)) and m(s2):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import bisect
import math
def solve():
  s = int(input())
  if s//100 == 0 or 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 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:
s = input()
if (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 int(s[0:2]) <= 12 and int(s[2:4]) <= 12:
    print('AMBIGUOUS')
elif int(s[0:2]) <= 12:
    print('MMYY')
elif int(s[2:4]) <= 12:
    print('YYMM')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
try:
    s = input()

except EOFError:
    pass

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

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')
  else:
    print('YYMM')
else:
  if(Y==0):
    print('YYMM')
  elif(Y<13):
    print('AMBIGUOUS')
  else:
    print('MMYY')

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 = str(input())
S_list = list(S)


S12 = int(S_list[0]+S_list[1])
S34 = int(S_list[2]+S_list[3])

flagYYMM = 0
flagMMYY = 0

if S12 == 00 or S34 == 00:
    print("NA")
    exit()

if S34 <= 12:
    flagYYMM = 1

if S12 <= 12:
    flagMMYY = 1

if flagYYMM == 1 and flagMMYY == 1:
    print("AMBIGUOUS")

elif flagYYMM == 1:
    print("YYMM")

elif flagMMYY == 1:
    print("MMYY")

Submission status: Wrong Answer

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

if a > 12 or a < 1:
	if b > 12 or b < 1:
		print('NA')
	else:
		print('YYMM')
else:
	if b > 12 or b < 1:
		print('YYMM')
	else:
		print('AMBIGUOUS')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
S=input()
S1=int(S[0:2])
S2=int(S[2:4])
#print(S1,S2)
if S1==0 and S2==0:print("NA");exit()
if S1==0:print("YYMM");exit()
if S2==0:print("MMYY");exit()
if S1>12 and S2>12:print("NAa");exit()
if S1>12:print("YYMM");exit()
if S2>12:print("MMYY");exit()
print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
S = input()
flag1 = False
flag2 = False

num1 = int(S[0] + S[1])
num2 = int(S[2] + S[3])

if num1 > 0 and (num2 >= 1 and num2 <= 12):
    flag1 = True

if (num1 >= 1 and num1 <= 12) and num2 > 0:
    flag2 = True
    

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

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 'N' or s_b_re[0] in 'N':
  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()

yy=int(s[:2])
mm=int(s[2:])

if yy - mm >= 12 and mm > 0:
    print('YYMM')
elif yy - mm <= -12 and yy > 0:
    print('MMYY')
elif yy - mm >= -12 and yy -mm <= 12 and yy >0 and mm > 0:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
w=input().strip()

w1 = w[:2]
w2 = w[2:]

m = list(map(lambda x:'%02d' % x, range(1, 13)))
y = list(map(lambda x:'%02d' % x, range(0, 100)))


f1 =  w1 in m
f2 =  w1 in y
f3 =  w2 in m
f4 =  w2 in y

# YYMM
if ((not f1) and (f2)) and (f3):
    print('YYMM')
# MMYY
elif ((f1) and (not f2))and (f4) :
    print("MMYY")
elif (f1 and f4) or (f2 and f3):
    print("AMBIGUOUS")
else:
    print('NA')

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")
else: 
    print("NA")

Submission status: Wrong Answer

Solution code:

def main(s):
    big = int(s/ 100)
    small = s % 100

    if 1 <= big <= 12 and 1 <= small <= 12:
        print("AMBIGUOUS")
        return
    elif 1 <= big <= 12 and 12 < small:
        print("MMYY")
        return
    elif 12 < big and 1 <= small <= 12:
        print("YYMM")
        return
    else:
        print("NA")
        return
        
if __name__ == '__main__':
    try:
        s = int(input().strip())
        main(s)
    except EOFError:
        pass

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 '00'<=S[:2]<='19':year_1 = True
    month_2 = False
    year_2 = False
    if '01'<=S[2:]<='12':month_2 = True
    if '00'<=S[2:]<='19':year_2 = True
    
    if month_1 and month_2 and year_1 and year_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 = input()

mae = s[:2]
usiro = s[2:]

flag = ''

if 1 <= int(mae) <= 12 and int(usiro) > 12:
    flag = 'MMYY'
if 1 <= int(usiro) <= 12 and int(mae) > 12:
    flag = 'YYMM'
if 1 <= int(mae) <= 12 and 1 <= int(usiro) <= 12:
    flag = 'AMBIGUOUS'
if int(mae) > 12 and int(usiro) > 12:
    flag = 'NA'
if int(mae) > 12 and int(usiro) == 0:
    flag ='NA'
if int(usiro) > 12 and int(mae) == 0:
    flag ='NA'

print(flag)

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 > 12 and ato > 12 :
        return "NA"
    if mae < 13 and ato < 13 :
        return "AMBIGUOUS"
    
    if mae < 13 :
        return "MMYY"
    if mae > 12 :
        return "YYMM"


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

Submission status: Wrong Answer

Solution code:
S=str(input())
n1=int(S[0:2])
n2=int(S[2:4])

YYMM = 0
MMYY = 0

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:

def main():
    s = input()
    start = int(s[0:2])
    end = int(s[2:4])
    if end <= 12 and (start <= 12 and start > 0):
        print("AMBIGUOUS")
    elif (end > 0 and end <= 12) and start > 12:
        print("YYMM")
    elif end > 12 and (start <= 12 and start > 0):
        print("MMYY")
    elif end > 12 and start > 12:
        print("NA")
    else:
        print("NA")
main()

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 or YY > 12:
  print("YYMM")

else:
  print("AMBIGUOUS")

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

Submission status: Wrong Answer

Solution code:
s=input()

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

ans=""

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

print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())
result = None
former = 0
latter = 0
if int(S[0]) == 0:
    if int(S[1]) == 0:
        result = 'NA'
    else:
        former = int(S[1])
else:
    former = int(S[0]+S[1])

if int(S[2]) == 0:
    if int(S[3]) == 0:
        result = 'NA'
    else:
        latter = int(S[3])
else:
    latter = int(S[2] + S[3])

if result is not None:
    print(result)
else:
    if former > 12 and latter > 12:
        print('NA')
    elif former > 12 and latter < 13:
        print('YYMM')
    elif former < 13 and latter > 12:
        print('MMYY')
    elif former < 13 and latter < 13:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S=input()

first=int(S[0]+S[1])
second=int(S[2]+S[3])


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

Submission status: Wrong Answer

Solution code:
# N = int(input())
# N, K = map(int, input().split())
# A = list(map(int, input().split()))

def f(S):
    F = int(S[:2])
    B = int(S[2:])

    if F == 0 or B == 0:
        print("NA")
    elif 1 <= F <= 12:
        if 1 <= B <= 12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if 1 <= B <= 12:
            print("YYMM")
        else:
            print("NA")

f(input())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def isMM(a):
  return 1 <= a and a <= 12

r = isMM(x) * 2 + isMM(y)

print(["NA", "YYMM", "MMYY", "AMBIGIOUS"][r])

Submission status: Wrong Answer

Solution code:
# Your code here!
 
X = [x for x in input()]
A = int(''.join(X[:2]))
B = int(''.join(X[2:]))
 
if A == 0 or B == 0:
  	print('NA')
elif A > 0 and B > 0 and A <= 12 and B <= 12:
    print('AMBIGUOUS')
elif A > 0 and B > 0 and B <= 12:
    print('YYMM')
elif B > 0 and A > 0 and A <= 12:
    print('MMYY')
else:
    print('NA')