Problem:


Score : 200 points

Problem Statement

You have a digit sequence S of length 4. You are wondering which of the following formats S is in:

YYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order

MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order

If S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.

Constraints

S is a digit sequence of length 4.

Input

Input is given from Standard Input in the following format:

S

Output

Print the specified string: YYMM, MMYY, AMBIGUOUS or NA.

Sample Input 1

1905

Sample Output 1

YYMM

May XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.

Sample Input 2

0112

Sample Output 2

AMBIGUOUS

Both December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.

Sample Input 3

1700

Sample Output 3

NA

Neither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.



Sample input:
1905


Sample output:
YYMM

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,a,b,b = str(input())

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

Submission status: Wrong Answer

Solution code:
a,a,b,b = str(input())

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

Submission status: Wrong Answer

Solution code:
S = input()
head, tail = int(S[:2]), int(S[2:])

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

Submission status: Wrong Answer

Solution code:
S = input()
head, tail = int(S[:2]), int(S[2:])

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

Submission status: Wrong Answer

Solution code:
#N, K = [int(i) for i in input().split()]
S = input()

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

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

Submission status: Wrong Answer

Solution code:
S = list(input())
# 1 <= Y <= 99
# 1 <= M <= 12
if 1 <= int(S[0]+S[1]) <= 12:
    if 1 <= int(S[2]+S[3]) <= 12:
        print('AMBIGUOUS')
        exit()
if 1 <= int(S[0]+S[1]) <= 99:
    if 1 <= int(S[2]+S[3]) <= 12:
        print('YYMM')
        exit()
if 1 <= int(S[0]+S[1]) <= 12:
    if 1 <= int(S[2]+S[3]) <= 99:
        print('MMYY')
        exit()
print('NA')

Submission status: Wrong Answer

Solution code:
S = list(input())
# 1 <= Y <= 99
# 1 <= M <= 12
if 1 <= int(S[0]+S[1]) <= 12:
    if 1 <= int(S[2]+S[3]) <= 12:
        print('AMBIGUOUS')
        exit()
elif 1 <= int(S[0]+S[1]) <= 99:
    if 1 <= int(S[2]+S[3]) <= 12:
        print('YYMM')
        exit()
elif 1 <= int(S[0]+S[1]) <= 12:
    if 1 <= int(S[2]+S[3]) <= 99:
        print('MMYY')
        exit()
print('NA')

Submission status: Wrong Answer

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

li1 = [a,b]
li2 = [c,d]

int1 = int(''.join(li1))
int2 = int(''.join(li2))

if (int1 > 12 and int2 > 12):
    ans = 'NA'
elif (int1 == 0 and int2 == 0):
    ans = 'NA'
elif (int1 > 12 and int2 == 0):
    ans = 'NA'
elif (int2 > 12 and int1 == 0):
    ans = 'NA'
elif (int1 > 12):
    ans = 'YYMM'
elif (int2 > 12):
    ans = 'MMYY'
else:
    ans = 'AMBIGUOUS'

print(ans)

Submission status: Wrong Answer

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

li1 = [a,b]
li2 = [c,d]

int1 = int(''.join(li1))
int2 = int(''.join(li2))

if (int1 > 12 and int2 > 12):
    ans = 'NA'
elif (int1 == 0 and int2 == 0):
    ans = 'NA'
elif (int1 > 12 and int2 == 0):
    ans = 'NA'
elif (int1 > 12):
    ans = 'YYMM'
elif (int2 > 12 and int1 == 0):
    ans = 'NA'
elif (int2 > 12):
    ans = 'MMYY'
else:
    ans = 'AMBIGUOUS'

print(ans)

Submission status: Wrong Answer

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

li1 = [a,b]
li2 = [c,d]

int1 = int(''.join(li1))
int2 = int(''.join(li2))

if (int1 > 12 and int2 > 12):
    ans = 'NA'
elif (int1 == 0 and int2 == 0):
    ans = 'NA'
elif int1 > 12:
    ans = 'YYMM'
elif int2 > 12:
    ans = 'MMYY'
else:
    ans = 'AMBIGUOUS'

print(ans)

Submission status: Wrong Answer

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

li1 = [a,b]
li2 = [c,d]

int1 = int(''.join(li1))
int2 = int(''.join(li2))

if (int1 > 12 and int2 > 12):
    ans = 'NA'
elif (int1 == 0 or int2 == 0):
    ans = 'NA'
elif int1 > 12:
    ans = 'YYMM'
elif int2 > 12:
    ans = 'MMYY'
else:
    ans = 'AMBIGUOUS'

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
if 1 <= int(S[0:2]) <= 12:
    if 1 <= int(S[2:]) <= 12:
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    if 1 <= int(S[2:]) <= 12:
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

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

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

#print(judge_list_MM)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def mon(n):
  return n>=1 and n<=12
def yea(n):
  return n>=1 and n<=99

if mon(a) and yea(b) and mon(b) and yea(a):
  print('AMBIGUOUS')
elif mon(a) and yea(b):
  print('MMYY')
elif mon(b) and yea(a):
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

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

def mon(n):
  return n>=1 and n<=12
def yea(n):
  return n>=1 and n<=99

if mon(a) and yea(b) and mon(b) and yea(a):
  print('AMBIGUOUS')
elif mon(a) and yea(b):
  print('MMYY')
elif mon(b) and yea(a):
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
A=input()
Y=int(A[0])*10+int(A[1])
M=int(A[2])*10+int(A[3])
code=0
if Y<19:
    if M>0 and M<13:
        code=1

if M<19:
    if Y>0 and Y<13:
        if code==1:
            code=3
        else:
            code=2
if Y==19:
   if M>0 and M<6:
        code=3
if Y<6 and Y>0:
   if M==19:
        code=3
        
if code == 0:
    print("NA")
if code ==1:
    print("YYMM")
if code ==2:
    print("MMYY")
if code == 3:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
A=input()
Y=int(A[0])*10+int(A[1])
M=int(A[2])*10+int(A[3])
code=0
if Y<20:
    if M>0 and M<13:
        code=1

if M<20:
    if Y>0 and Y<13:
        if code==1:
            code=3
        else:
            code=2
if Y==19:
   if M==12:
        code=2
if Y==12:
   if M==19:
        code=1
        
if code == 0:
    print("NA")
if code ==1:
    print("YYMM")
if code ==2:
    print("MMYY")
if code == 3:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
A=input()
Y=int(A[0])*10+int(A[1])
M=int(A[2])*10+int(A[3])
code=0
if Y<20:
    if M>0 and M<13:
        code=1

if M<20:
    if Y>0 and Y<13:
        if code==1:
            code=3
        else:
            code=2
        
if code == 0:
    print("NA")
if code ==1:
    print("YYMM")
if code ==2:
    print("MMYY")
if code == 3:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
front = int(S[0:2])
back = int(S[2:4])

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

Submission status: Wrong Answer

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

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def isMM(s2):
    d = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
    return s2 in d

def main():
    s = input()
    if isMM(s[0:2]):
        if isMM(s[2:]):
            print("AMBIGUOUS")
        else:
            print("YYMM")
    else:
        if isMM(s[2:]):
            print("YYMM")
        else:
            print("NA")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
ans=0
if b<32 and b!=00:
    ans+=1
if a<32 and a!=00:
    ans+=2
if ans==3:
    print("AMBIGUOUS")
elif ans==2:
    print("MMYY")
elif ans==1:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
ans=0
if b<32 and a!=00 and b!=00:
    ans+=1
if a<32 and a!=00 and b!=00:
    ans+=2
if ans==3:
    print("AMBIGUOUS")
elif ans==2:
    print("MMYY")
elif ans==1:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
ans=0
if b<32:
    ans+=1
if a<32:
    ans+=2
if ans==3:
    print("AMBIGUOUS")
elif ans==2:
    print("MMYY")
elif ans==1:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())

if 0 < S // 100 <= 12 and 0 < S % 100<= 12:
    print("AMBIGUOUS")
elif S // 100 <= 12:
    print("MMYY")
elif 0 < S % 100 <= 12:
    print("YYMM")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())

if S // 100 <= 12 and 0 < S % 100<= 12:
    print("AMBIGUOUS")
elif S // 100 <= 12:
    print("MMYY")
elif 0 < S % 100 <= 12:
    print("YYMM")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
s=list(input())

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

if (0 < former <13) and (0<latter<13):
  print("AMBIGUOUS")
elif (0 < former <13) and (not latter==0):
  print("MMYY")
elif (not former ==0) and (0 < latter <13):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

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

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

if (first == 0):
    if (second == 0):
        print("NA")
    elif (1 <= second <= 12):
        print("YYMM")
    elif (13 <= second <= 99):
        print("NA")
    else:
        print("NA")
elif (1 <= first <= 12):
    if (second == 0):
        print("MMYY")
    elif (1 <= second <= 12):
        print("AMBIGUOUS")
    elif (13 <= second <= 99):
        print("MMYY")
    else:
        print("NA")
elif (13 <= first <= 99):
    if (second == 0):
        print("NA")
    elif (1 <= second <= 12):
        print("YYMM")
    elif (13 <= second <= 99):
        print("AMBIGUOUS")
    else:
        print("NA")
else:
    print("NA")

Submission status: Wrong Answer

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

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

if (first == 0):
    if (second == 0):
        print("AMBIGUOUS")
    elif (1 <= second <= 12):
        print("YYMM")
    elif (13 <= second <= 99):
        print("AMBIGUOUS")
    else:
        print("NA")
elif (1 <= first <= 12):
    if (second == 0):
        print("MMYY")
    elif (1 <= second <= 12):
        print("AMBIGUOUS")
    elif (13 <= second <= 99):
        print("MMYY")
    else:
        print("NA")
elif (13 <= first <= 99):
    if (second == 0):
        print("NA")
    elif (1 <= second <= 12):
        print("YYMM")
    elif (13 <= second <= 99):
        print("AMBIGUOUS")
    else:
        print("NA")
else:
    print("NA")

Submission status: Wrong Answer

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

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

if (first == 0):
    if (second == 0):
        print("NA")
    elif (1 <= second <= 12):
        print("YYMM")
    elif (13 <= second <= 99):
        print("AMBIGUOUS")
    else:
        print("NA")
elif (1 <= first <= 12):
    if (second == 0):
        print("MMYY")
    elif (1 <= second <= 12):
        print("AMBIGUOUS")
    elif (13 <= second <= 99):
        print("MMYY")
    else:
        print("NA")
elif (13 <= first <= 99):
    if (second == 0):
        print("NA")
    elif (1 <= second <= 12):
        print("YYMM")
    elif (13 <= second <= 99):
        print("AMBIGUOUS")
    else:
        print("NA")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = str(input())

date = [int(s[:2]), int(s[2:])]

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

Submission status: Wrong Answer

Solution code:
s = str(input())

date = [int(s[:2]), int(s[2:])]

if 1 <= date[0] <= 12 and 1 <= date[1] <= 12 and date[0] > 0 and date[1] > 0:
    print('AMBIGUOUS')
elif date[0] > 0 and 1 <= date[1] <= 12:
    print('YYMM')
elif 1 <= date[0] <= 12 and date[1] > 0:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = str(input())

ay=0
am=0
zy=0
zm=0

date = [int(s[:2]), int(s[2:])]

if 1 <= date[0] <= 12:
    am = 1
if 1 <= date[1] <= 12:
    zm = 1
    
if date[0] != 0:
    ay = 1
if date[1] != 0:
    zy = 1

if ay == am == zy == zm == 1:
    print('AMBIGUOUS')
elif ay == zm == 1:
    print('YYMM')
elif am == zy == 1:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=list(input())

# s1 = (int)(s[0] + s[1])
s1=int(s[0])*10+int(s[1])
s2=int(s[2])*10+int(s[3])

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

Submission status: Wrong Answer

Solution code:
n=input()
ym=0
my=0
if n[0]=="0":
  if int(n[1])!=0:
    my=1
  else:
    my=-1
elif n[0]=="1":
  if int(n[1])==1 or int(n[1])==2:
    my=1
  else:
    my=-1
else:
  my=-1
if n[2]=="0":
  if int(n[3])!=0:
    ym=1
  else:
    ym=-1
elif n[2]=="1":
  if int(n[3])==1 or int(n[3])==2:
    ym=1
  else:
    ym=-1
else:
  ym=-1
if my and ym:
  print("AMBIGUOUS")
elif my:
  print("MMYY")
elif ym:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = input()

left = int(S[:2])
right = int(S[2:])
left_mm_flag = False
left_yy_flag = False
right_mm_flag = False
right_yy_flag = False

if 1 <= left <= 99:
    if left <= 12:
        left_mm_flag = True
        left_yy_flag = True
    else:
        left_yy_flag = True

if 1 <= right <= 99:
    if right <= 12:
        right_mm_flag = True
        right_yy_flag = True
    else:
        right_yy_flag = True

if left_mm_flag and right_yy_flag and left_yy_flag and right_mm_flag:
    print('AMBIGUOUS')
elif left_yy_flag and right_mm_flag:
    print('YYMM')
elif left_mm_flag and right_yy_flag:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

left = int(S[:2])
right = int(S[2:])
left_mm_flag = False
left_yy_flag = False
right_mm_flag = False
right_yy_flag = False

if 1 <= left <= 99:
    if left <= 12:
        left_mm_flag = True
        left_yy_flag = True
    else:
        left_yy_flag = True

if 1 <= right <= 99:
    if right <= 12:
        right_mm_flag = True
        right_yy_flag = True
    else:
        right_yy_flag = True

if left_mm_flag and right_yy_flag and left_yy_flag and right_mm_flag:
    print('AMBIGUOUS')
elif left_yy_flag and right_mm_flag:
    print('YYMM')
elif left_mm_flag and right_yy_flag:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
mae = s[:2]
ato = s[2:]
val = ""
if mae == "00":
	if ato == "00":
		val = "NA"
	elif int(ato) >= 13:
		val = "NA"
	else:
		val = "YYMM"
elif int(mae) >= 13:
	if ato == "00":
		val = "NA"
	elif int(ato) >= 13:
		val = "NA"
	else:
		val = "YYMM"
else:
	if int(ato) >= 13:
		val = "MMYY"
	else:
		val = "AMBIGUOUS"
print (val)

Submission status: Wrong Answer

Solution code:
s = input()
mae = s[:2]
ato = s[2:]
val = ""
if mae == "00" or ato == "00":
	val = "NA"
elif int(mae) >= 13:
	if int(ato) >= 13:
		val = "NA"
	else:
		val = "YYMM"
elif int(ato) >= 13:
	if int(mae) >= 13:
		val = "NA"
	else:
		val = "MMYY"
else:
	val = "AMBIGUOUS"
print (val)

Submission status: Wrong Answer

Solution code:
s = input()
mae = s[:2]
ato = s[2:]
val = ""
if mae == "00" or ato == "00":
	val = "NA"
elif int(mae) >= 13:
	if int(ato) >= 13:
		val = "NA"
	else:
		val = "YYMM"
elif int(ato) >= 13:
	val = "MMYY"
else:
	val = "AMBIGUOUS"
print (val)

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = input()
u = int(S[0]) * 10 + int(S[1])
d = int(S[2]) * 10 + int(S[3])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
if int(S[:3]) == 0 or int(S[-2:]) == 0:
  print("NA")
elif int(S[:3]) <= 12:
  if int(S[-2:]) <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
elif int(S[-2:]) <= 12:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
S = input()
S1 = int(S[:2])
S2 = int(S[2:])
A = (S1 >= 1 and S1 <= 12)
B = (S2 >= 1 and S2 <= 12)
if(A and B):
  print('ANBIGUOUS')
elif(A and not B):
  print('MMYY')
elif(not A and B):
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
u = int(S[0]) * 10 + int(S[1])
d = int(S[2]) * 10 + int(S[3])

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

Submission status: Wrong Answer

Solution code:
S = input()
u = int(S[0]) * 10 + int(S[1])
d = int(S[2]) * 10 + int(S[3])

if u > 12 and d <= 12:
  print("YYMM")
elif u <= 12 and d >12:
  print("MMYY")
elif u <= 12 and d <= 12:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = list(input())
f = int((''.join(S[0:2])))
b = int((''.join(S[2:4])))
def month(m):
    if 1 <= m <= 12:# 0xはxの数値として変換される模様
        return 1
    else:
        return 0
def year(y):
    if y == 0:
        return 0
    else:
        return 1
ans = [month(f),year(b),year(f),month(b)]#グリット組みたい
#print(ans)
if sum(ans) == 4:
    print('AMBIGUOUS')
elif ans[0] == 1 and ans[1] == 1:
    print('MMYY')
elif ans[2] == 1 and ans[3] == 1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

S = int(input())

# YYMM: XX00~XX12
# MMYY: 00YY~12YY
yymm = 0
mmyy = 0

if S % 100 <= 12:
    yymm = 1
if S // 100 <= 12:
    mmyy = 1

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

Submission status: Wrong Answer

Solution code:
S=list(input())
b1=int(S[0]+S[1])
b2=int(S[2]+S[3])
if 0<b1<13 and 0<b2<13:
    print('AMBIGUOUS')
    #==========
elif b1>12 and 13>b2>0:
    print('YYMM')
elif 0<b1<13 and (b2==0 or b2>12):
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S=list(input())
b1=int(S[0]+S[1])
b2=int(S[2]+S[3])
if 0<b1<13 and 0<b2<13:
    print('AMBIGUOUS')
elif b1>12 and b2!=0:
    print('YYMM')
elif 0<b1<13 and b2==0:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
#s = int(input())
#first = s//100
#second = s%100
s=input()
first = int(s[:2])
second = int(s[2:])
#print(first,second)

if (first > 12 or first < 1) and (second > 12 or second < 1):
  print('NA') # YY/YY
elif first > 12 and (second > 0 and second <=12):
  print('YYMM')
elif (first > 0 and first <= 12) and second > 12:
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
#s = int(input())
#first = s//100
#second = s%100
s=input()
first = int(s[:2])
second = int(s[2:])
#print(first,second)

if (first > 12 or first < 1) and (second > 12 or second < 1):
  print('NA') # YY/YY
elif first > 12 and second <=12:
  print('YYMM')
elif first <= 12 and second > 12:
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
#s = int(input())
#first = s//100
#second = s%100
s=input()
first = int(s[:2])
second = int(s[2:])
#print(first,second)

if first > 12 and second > 12:
  print('NA') # YY/YY
elif first > 12 and second <=12:
  print('YYMM')
elif first <= 12 and second > 12:
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
N1 = S[:2]
N2 = S[2:]
N1 = int(''.join(N1))
N2 = int(''.join(N2))

if N1 >= 13 and 1 <= N2 <= 12:
    print('YYMM')
elif 1 <= N1 <= 12 and N2 >= 13:
    print('MMYY')
elif 1 <= N1 <= 12 and 1 <=N2 <= 12:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    first = int(''.join(s[:2]))
    end = int(''.join(s[2:4]))

    if end<=0 or first<=0:
        print('NA')
        return
    if first <= 12:
        if end <= 12:
            print('AMBIGUOUS')
            return
        else:
            print('MMYY')
            return
    else:
        if end <= 12:
            print('YYMM')
            return
        else:
            print('NA')
            return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = list(input())
up = int(''.join(s[:2]))
low = int(''.join(s[2:]))

if up > 0 and up < 13:
  if low > 0 and low < 13:
    print('AMBIGUOUS')
  
  elif low > 0:
    print('MMYY')
  
  else:
    print('NA')

elif low > 0 and low < 13:
  if up > 0:
    print('YYMM')
  else:
    print('NA')
    
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: int):

    if 1 <= int(S[:2]) <= 99 and 1 <= int(S[2:]) <= 12:
        if 1 <= int(S[:2]) <= 12:
            print("AMBIGUOUS")
        else:
            print("YYMM")
    elif 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 99:
        if 1 <= int(S[2:]) <= 12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        print("NA")

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    S = str(next(tokens))  # type: int
    solve(S)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: int):

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

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    S = str(next(tokens))  # type: int
    solve(S)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=input()
i=0
a=int(n[0]+n[1], 10)
b=int(n[2]+n[3],10)
if a<13 and b<13:
  print('AMBIGUOUS')
elif b<13:
  print('YYMM')
elif a<13:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s12 = s[0] + s[1] 
s34 = s[2] + s[3]

if int(s12) >= 13 or s12 == "00": ## s12はMMでない YY
  if int(s34) >= 13 or s34 == "00": ## s34はMMでない YY
    print("NA")
  else: ## s34はMM
    print("YYMM")
else:
  if 1 <= int(s12) <= 12:
    if 1 <= int(s12) <= 12:
      print("AMBIGUOUS")
    else:
      print("MMYY")

Submission status: Wrong Answer

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