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

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

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

Submission status: Wrong Answer

Solution code:
S = str(input())

front = int(S[:2])
back = int(S[2:4])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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


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

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

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

Submission status: Wrong Answer

Solution code:
S = input()
S1 = S[:1]
S2 = S[2:]
month = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']

if S1 in month and S2 in month:
	print('AMBIGUOUS')
elif S1 in month:
	print('MMYY')
elif S2 in month:
	print('YYMM')
else:
	print('NA')

Submission status: Wrong Answer

Solution code:
import numpy as np
import fractions

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

Submission status: Wrong Answer

Solution code:
s = input()

front = int(s[:2])
back = int(s[2:])

if(back > 0 and back < 13):
	if(front > 12 or front == 0):
		print("YYMM")
	elif(front > 0):
		print("AMBIGOUS")
elif(front > 0 and front < 13):
	if(back > 12 or back == 0):
		print("MMYY")
	elif(back > 0):
		print("AMBIGOUS")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
string = input()
numlist = [int(n) for n in string]
fst = numlist[0] * 10 + numlist[1]
scd = numlist[2] * 10 + numlist[3]

if fst > 12:
    if scd > 12:
        print('NA')
    else:
      	print('YYMM')
else:
    if scd > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')

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

Submission status: Wrong Answer

Solution code:
def check_str(checked_str):
    if int(checked_str) < 1 or int(checked_str) > 31:
        return 2
    elif int(checked_str) > 0 and int(checked_str) <= 12:
        return 0
    elif int(checked_str) >= 13 and int(checked_str) <= 31:
        return 1


tar_str = input()

tar_str1 = tar_str[:2]
tar_str2 = tar_str[2:4]

is_tar_str1 = check_str(tar_str1)
is_tar_str2 = check_str(tar_str2)

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

Submission status: Wrong Answer

Solution code:
S = input()

head = int(S[0:2])
tail = int(S[2:4])


def check(head, tail):
    if head <= 0 or tail <= 0:
        return 'NA'
    if head > 12 and tail > 12:
        return 'NA'
    if head > 12 and tail <= 12:
        return 'YYMM'
    if head <= 12 and tail > 12:
        return 'MMYY'
    if head <= 12 and tail <= 12:
        return 'AMBIGUOUS'


print(check(head, tail))

Submission status: Wrong Answer

Solution code:
S = input()

f = S[:2]
e = S[2:]

front = int(f)
end = int(e)

if front < 0:
    print("NA")
elif front > 12:
    if end > 12 or end == 00 or end < 0:
        print("NA")
    else:
        print("YYMM")

elif front != 00:
    if end > 12:
        print("MMYY")
    elif end == 00 or end < 0:
        print("NA")
    else:
        print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = input()
AA, BB = int(s[:2]), int(s[2:])

if 1<= AA <= 12 and 1 <= BB <= 12: 
    print("AMBIGUOUS")
elif AA < 1 or BB < 1: 
    print("NA")
elif AA <= 12: 
    print("MMYY")
else: 
    print("YYMM")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())

front = int(S[:2])
back = int(S[2:4])

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

Submission status: Wrong Answer

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


def judge(n):
    if 0 < n < 13:
        return 0
    elif 0 < n:
        return 1
    else:
        return 2

s_1 = judge(s_1)
s_2 = judge(s_2)

if s_1 == 2 or s_2 == 2 or (s_1 == 1 and s_2 == 1):
    print("NA")
elif s_1 == 1:
    print("YYMM")
elif s_2 == 1:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
String=input()
String=list(String)
String=[(String[i:i+2]) for i in range(0, len(String),2)]
String[0]="".join(String[0])
String[1]="".join(String[1])
String[0]=int(String[0])
String[1]=int(String[1])
if(String[0]>=0 and String[0]<=12and String[1]>0 and String[1]<=12):
    print("AMBIGUOUS")
elif(String[1]>0 and String[1]<13):
    print("YYMM")
elif(String[0]>0 and String[0]<13):
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
tmp = s[:2]
tmp2 = s[2:]

if int(tmp) == 0:
    if int(tmp2) == 0 or int(tmp2) > 12:
        print("NA")
    else:
        print("YYMA")
elif int(tmp2) == 0:
    if int(tmp) > 12:
        print("NA")
    else:
        print("MMYY")
elif int(tmp) > 12 and 0 < int(tmp2):
    print("YYMM")
elif int(tmp) > 0 and int(tmp2) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
import sys

s=input()

if (s[:2] == '00' or s[2:] == '00'):
    print('NA')
    sys.exit()

if s[0] == '0':
    if s[2] == '0':
        print('AMBIGUOUS')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
            print('AMBIGUOUS')
    else:
        print('MMYY')

elif s[0] == '1':
    if(s[:2] == '10' or s[:2] == '11' or s[:2] == '12'):
        if s[2] == '0':
            print('AMBIGUOUS')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if s[2] == '0':
            print('YYMM')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
        else:
            print('NA')


else:
    if s[2] == '0':
        print('YYMM')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '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('MMYY')
elif S//100>12 and 0<S%100<12:
    print('YYMM')
elif 0<S%100<=12 and 0<S//100<=12:
    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]) > 0 and int(S[2:4]) <= 12:
        print("AMBIGUOUS")
    elif int(S[2:4]) > 0:
        print("MMYY")
        
elif int(S[2:4]) <= 12 and int(S[2:4]) > 0:
    if int(S[0:2]) > 0 and int(S[0:2]) <= 12:
        print("AMBIGUOUS")    
    elif int(S[0:2]) > 0:
        print("YYMM")

elif int(S[0:2]) >= 13:
    if int(S[2:4]) <= 0:
        print("NA")

elif int(S[2:4]) >= 13:
    if int(S[0:2]) <= 0:
        print("NA")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
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) or (mm == 0)):
    print("MMYY")
elif (0 < yy <= 12) and (0 < mm <= 12):
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

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

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 < 0 or s1 > 19) and (s2 < 1 or s2 > 12):
        print("NA")
    elif s1 > 13 and s2 < 13:
        print("YYMM")
    elif s1 < 13 and s2 > 13:
        print("MMYY")
    else:
        print("AMBIGUOUS")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] == '0' or (S[0] == '1'and (S[1] == '0' or S[1] == '1' or S[1]=='2')):
  if S[2] == '0' or (S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2')):
    print('AMBIGUOUS')
  else:
    print('MMYY')
elif S[2] == '0' or (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()

flagMMYY = True
flagYYMM = True
flaga0 = True
flagb0 = True

a = int(s[:2])
b = int(s[2:4])

if a > 12:
    flagMMYY = False

if b > 12:
    flagYYMM = False

if a == 0:
    flaga0 = False

if b == 0:
    flagb0 = False

if flagMMYY and flagYYMM and flaga0 and flagb0:
    print("AMBIGUOUS")
elif flagMMYY and flagYYMM and flaga0 or flagb0 == False:
    print("NA")
elif (flagMMYY == False) and (flagYYMM == True):
    print("YYMM")
elif (flagMMYY == True) and (flagYYMM == False):
    print("MMYY")

Submission status: Wrong Answer

Solution code:
from functools import reduce
s=input()
l = [int(x) for x in list(str(s))]
a= int(reduce(lambda x, y: x + y, [str(x) for x in l[0:2]]))
b= int(reduce(lambda x, y: x + y, [str(x) for x in l[2:4]]))
if (a>12 and b>12) or (a==0 and b>12) or (a>12 and b==0):
    print('NA')
elif 00<a<13 and 00<b<13:
    print('AMBIGUOUS')
elif a>12 and 0<b<13:
    print('YYMM')
elif 0<a<13 and 0<b:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
    if(0<a//100<13):
      print("YYMM")
    else:
      print("NA")

Submission status: Wrong Answer

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


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


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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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)
elif MM <= 12 and YY <= 12:
  print("AMBIGUOUS")
  exit(0)

if MM >= 13 and YY >= 13:
  if MM == YY:
    print("NA")
    exit(0)
  
if YY > 12:
  print("YYMM")
elif MM > 12:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
import sys

s=input()

if (s[:2] == '00' or s[2:] == '00'):
    print('NA')
    sys.exit()

if s[0] == '0':
    if s[2] == '0':
        print('AMBIGUOUS')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
            print('AMBIGUOUS')
        else:
            print('MMYY')

elif s[0] == '1':
    if(s[:2] == '10' or s[:2] == '11' or s[:2] == '12'):
        if s[2] == '0':
            print('AMBIGUOUS')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if s[2] == '0':
            print('YYMM')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
        else:
            print('NA')


else:
    if s[2] == '0':
        print('YYMM')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
data = input()

first = data[:2]
second = data[2:]

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

Submission status: Wrong Answer

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

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

if 0 < first and first < 13:
    if 0 < second and second < 13:
        print("AMBIGUOUS")
    elif (13 <= second):
        print("MMYY")
    else:
        print("YYMM")

elif 13 <= first:
    if 0 < second and second < 13:
        print("YYMM")
    elif (13 <= second):
        print("NA")
    else:
        print("YYMM")

else:
    if 0 < second and second < 13:
        print("YYMM")
    elif 13 <= second:
        print("NA")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

head = int(S[0:2])
tail = int(S[2:4])


def check(head, tail):
    if head <= 0 or tail <= 0:
        return 'NA'

    if head > 12 and tail > 12:
        return 'NA'

    if head > 12 and tail <= 12:
        return 'YYMM'
    if head <= 12 and tail > 12:
        return 'MMYY'

    if (head <= 12 or head >= 12) and (tail <= 12 or tail >= 12):
        return 'AMBIGUOUS'


print(check(head, tail))

Submission status: Wrong Answer

Solution code:
s = list(input())
if s[0] == "0":
    s[0] = ''
if s[2] == "0":
    s[2] = ''
x = int(s[0]+s[1])
y = int(s[2]+s[3])

if (x <= 12 and x >= 1) and (y >=1 and y <=12):
    print("AMBIGUOUS")

elif(x >0 and (y >= 1 and y <= 12)):
    print("YYMM")

elif(y >0 and (x >= 1 and x <= 12)):
    print("MMYY")

else:
    print("NA")

Submission status: Wrong Answer

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

s = input()
if int(s[:2]) > 12 and int(s[2:len(s)]) > 12\
        or s[2:len(s)] == "00":
        print("NA")
elif int(s[:2]) > 12 or 0 <= int(s[2:len(s)]) <= 12:
        print("YYMM")
elif 0 <= int(s[2:len(s)]) <= 12 or int(s[:2]) > 12:
        print("MMYY")
else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S=int(input())
month=S%100
year=(S-S%100)//100
if (month>=1 and month<=12) and (year>=1 and year<=12):
  print("AMBIGUOUS") 
elif (month>=1 and month<=12) and (year>=13 and year<=99): 
  print("YYMM") 
elif (year>=1 and year<=12) and (month>=13 and month<=99):
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

front = int(s[:2])
back = int(s[2:])

if(back > 0 and back < 13):
	if(front > 12):
		print("YYMM")
	elif(front > 0):
		print("AMBIGOUS")
elif(front > 0 and front < 13):
	if(back > 12):
		print("MMYY")
	elif(back > 0):
		print("AMBIGOUS")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
import numpy as np
import fractions
 
S = input()
F = int(S[0:2])
E = int(S[2:4])
if(F==0 or E==0 or (F>13 and E>13)):
    print("NA")
elif(F<13 and E<13):
    print("AMBIGUOUS")
elif(F<13 and E>13):
    print("MMYY")
elif(F>13 and E<13):
    print("YYMM")

Submission status: Wrong Answer

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


def main():
	YYMM = False
	MMYY = False
	s = input()
	a = int(s[0:2])
	b = int(s[2:4])
	if a != 0 and b != 0 and b < 13:
		YYMM = True
	if a < 13 and a != 0 and b != 0:
		MMYY = True
	
	if YYMM and MMYY:
		print('AMBIGUOUS')
	elif YYMM:
		print('YYMM')
	elif MMYY:
		print('MMYY')
	else:
		print('NA')

if __name__ == '__main__':
	import sys
	sys.exit(main())

Submission status: Wrong Answer

Solution code:
judge_num = "0000"
 
bef = int(judge_num[:2])
aft = int(judge_num[2:])

print(bef)
 
if(bef <= 12 and aft <= 12 and bef >= 1 and aft >= 1):
  print("AMBIGUOUS")
elif(bef <= 12 and bef >= 1):
  print("MMYY")
elif(aft <= 12):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
YY = S[:2]
MM = S[2:]

def main():
    if int(YY)>0 and int(YY)<13:
        if int(MM)>0 and int(MM)<13:
            print("AMBIGUOUS")
            return 

    if int(YY)>0:
        if int(MM)>0 and int(MM)<13:
            print("YYMM")
            return 

    if int(MM)>0 and int(MM)<13:
        print("MMYY")
        return
    else:
        print("NA")
        return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
# 入力
s = input()
pre = int(s[0:2])
post = int(s[2:len(s)])
 
# 計算と出力
if (pre == 0) or (post == 0) :
    print("NA")
elif (pre <= 12) and (post <= 12) :
    print("AMBIGUOUS")
elif (post > 12) :
    print("MMYY")
elif (pre > 12)  :
    print("YYMM")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
s = input()
s_list=list(s)
s_len=len(s_list)
s_first=int(s_list[0]+s_list[1])
s_second=int(s_list[2]+s_list[3])
if s_first<13 and s_first>0: #MMYY case
    if s_second<13 and s_second>0:
        print('AMBIGOUS')
    else:
        print('MMYY')

else: #YYMM case
    if s_second<13 and s_second>0:
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s=list(input())
h = int(s[0]+s[1])
t = int(s[2]+s[3])
y=0
m=0
if 0<h<13:
    y+=1
    m+=1
elif 12<h<32:
    m+=1
elif 0<t<13:
    y+=2
    m+=2
elif 12<t<32:
    m+=2
if y==3 and m==3:
    print("AMBIGUOUS")
elif y==0 and m==0:
    print("NA")
elif y==0:
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
S=int(input())

a=S/100
b=S%100

if(a>12 and b>12):
    print("NA")

elif(a==0 and b==0):
    print("NA")

elif((a>12 or a==0) and 1<=b<=12):
        print("YYMM")

elif(1<=a<=12 and (b>12 or b==0)):
        print("MMYY")

elif(1<=a<=12 and 1<=b<=12):
        print('AMBIGUOUS')

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
n=input()
n1=n[:2]
n2=n[2:4]
A=int(n1)
B=int(n2)
if A==0 or B==0:
    print("NA")
elif A<13:
    if B<13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if B<13:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

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

if A < 1 or B < 1:
  print('NA')

elif A > 12 and B > 12:
  print('NA')

elif A < 13 and B < 13:
  print('AMBIGUOUS')

elif A > 12:
  print('YYMM')

else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:
S = input()
fast = int(S[0:2])
end = int(S[2:4])

if 0 < fast < 13 and 0 < end < 13 :
  print('AMBIGUOUS')
elif 0 < fast and 0 < end < 13:
  print('YYMM')
elif 0 < fast < 13 and 0 < end:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''

def main():
    S = input()

    aa = int(S[:2])
    bb = int(S[2:])

    # print(aa,bb)
    if (aa > 12 and bb > 12) or aa == 0 or bb == 0:
        print("NA")
    elif aa <= 12 and aa != 0 and bb <= 12 and bb != 0:
        print("AMBIGUOUS")
    elif aa <= 12 and aa != 0:
        print("MMYY")
    elif bb <= 12 and bb != 0:
        print("YYMM")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
String=input()
String=list(String)
String=[(String[i:i+2]) for i in range(0, len(String),2)]
String[0]="".join(String[0])
String[1]="".join(String[1])
String[0]=int(String[0])
String[1]=int(String[1])
if(String[0]>=0 and String[0]<=12and String[1]>0 and String[1]<=12):
    print("AMBIGUOUS")
elif(String[0]==String[1]==0 or String[0]>12 and String[0]!=0 and String[1]>12 and String[1]!=0):
    print("NA")
elif(String[1]>0 and String[1]<13):
    print("YYMM")
elif(String[0]>0 and String[0]<13):
    print("MMYY")
elif(String[0]==0 and String[1]>12):
    print("NA")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import numpy as np
import fractions

#S = input()
S = "0101"
F = int(S[0:2])
E = int(S[2:4])
if(F==0 or E==0 or (F>13 and E>13)):
    print("NA")
elif(F<13 and E<13):
    print("AMBIGUOUS")
elif(F<13 and E>13):
    print("MMYY")
elif(F>13 and E<13):
    print("YYMM")

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
def solve():
    s = input()
    if len(str(s)) != 4 or isinstance(s, int):
        raise Exception('Error')
    sl = list(str(s))
    st = int("".join(sl[:2]))
    end = int("".join(sl[3:4]))
    if st > 0 and st <= 12 and end > 0 and end <= 12:
        print('AMBIGUOUS')
    elif st > 0 and st <= 12 and (end == 0  or end > 12):
        print('MMYY')
    elif (st == 0 or st > 12) and end > 0 and end <= 12:
        print('YYMM')
    else:
        print('NA')

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
S = input()

head = int(S[0:2])
tail = int(S[2:4])


def check(head, tail):
    if head <= 0 or tail <= 0:
        return 'NA'

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


print(check(head, tail))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s = input()
if int(s[:2]) > 12 and int(s[2:len(s)]) > 12\
        or s[2:len(s)] == "00":
        print("NA")
elif int(s[:2]) > 12 and 0 <= int(s[2:len(s)]) <= 12:
        print("YYMM")
elif 0 <= int(s[2:len(s)]) <= 12 and int(s[:2]) > 12:
        print("MMYY")
else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
print(type(S))

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


elif int(S[0:2]) >= 13:
    if int(S[2:4]) <= 0:
        print("NA")

elif int(S[2:4]) >= 13:
    if int(S[0:2]) <= 0:
        print("NA")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if 0 < first and first < 13:
    if 0 < second and second < 13:
        print("AMBIGUOUS")
    elif (13 <= second):
        print("MMYY")
    else:
        print("NA")

elif 13 <= first:
    if 0 < second and second < 13:
        print("YYMM")
    elif (13 <= second):
        print("NA")
    else:
        print("NA")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
s = input()
s_list=list(s)
s_len=len(s_list)
s_first=int(s_list[0]+s_list[1])
s_second=int(s_list[2]+s_list[3])
if s_first<13 and s_first>0: #MMYY case
    if s_second<13:
        print('AMBIGOUS')
    else:
        print('MMYY')

else: #YYMM case
    if s_second<13 and s_second>0:
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:

ans=""
S=input()
s1=S[:2]
s2=S[2:]
n1=int(s1)
n2=int(s2)

if (n1>12 and n2>12) or (n1==0 and n2==0) or (n1>12 and n2==0) or (n1==0 and n2>12):
    ans="NA"
elif n1>12 and n2<=12:
    ans="YYMM"
elif n1<=12 and n2>12:
    ans="MMYY"
elif n1<=12 and n2<=12:
    ans="AMBIGUOS"


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
a,b = int(S[0:2]),int(S[2:])
if 0 < a and a < 13 and (13 < b or b == 0):
  print("MMYY")
elif (13 < a or a == 0) and 0 < b and b < 13:
  print("YYMM")
elif a < 13 and b < 13 and a != 0 and b != 0:
  print("AMBIGUOUS")
else:
  print("NA")