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:
  f_mae = True
else:
  f_mae = False
  
if ato <= 12:
  f_ato = True
else:
  f_ato = False
 
if mae and ato:
  print("AMBIGOUS")
elif not mae and ato:
  print(str(mae) + str(ato))
elif mae and not ato:
  print(str(ato) + str(mae))
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

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

if mae <= 12:
  f_mae = True
if ato <= 12:
  f_ato = True

if mae and ato:
  print("AMBIGOUS")
elif not mae and ato:
  print(str(mae) + str(ato))
elif mae and not ato:
  print(str(ato) + str(mae))
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

ans1 = 'YYMM'
ans2 = 'MMYY'
ans3 = 'AMBIGUOUS'
ans4 = 'NA'

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

print(s1, s2)

if 0 < s1 < 13 and 0 < s2 < 13:
  print(ans3) 
elif 0 < s1 < 13:
  print(ans2) 
elif 0 < s2 < 13:
  print(ans1) 
else:
  print(ans4)

Submission status: Wrong Answer

Solution code:
S = input()

ans1 = 'YYMM'
ans2 = 'MMYY'
ans3 = 'AMBIGUOUS'
ans4 = 'NA'

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

if 1 < s1 < 13 and 1 < s2 < 13:
  print(ans3) 
elif 0 < s1 < 13:
  print(ans2) 
elif 0 < s2 < 13:
  print(ans1) 
else:
  print(ans4)

Submission status: Wrong Answer

Solution code:
S = list(input())

ans1 = 'YYMM'
ans2 = 'MMYY'
ans3 = 'AMBIGUOUS'
ans4 = 'NA'

myarray = []
myarray.append(int(S[0]+ S[1]))
myarray.append(int(S[2]+ S[3]))

if 1 < myarray[0] < 13 and 1 < myarray[1] < 13:
  print(ans3) 
elif 0 < myarray[0] < 13:
  print(ans2) 
elif 0 < myarray[1] < 13:
  print(ans1) 
else:
  print(ans4)

Submission status: Wrong Answer

Solution code:
S = list(input())

ans1 = 'YYMM'
ans2 = 'MMYY'
ans3 = 'AMBIGUOUS'
ans4 = 'NA'

myarray = []
myarray.append(int(S[0]+ S[1]))
myarray.append(int(S[2]+ S[3]))

if myarray[0] >=1 and myarray[1] >= 1:
  if myarray[0] > 12 and myarray[1] > 12:
    print(ans4) 
  if myarray[0] <= 12 and myarray[1] <= 12:
    print(ans3)
  if myarray[0] <= 12 and myarray[1] > 12:
    print(ans2)
  if myarray[0] > 12 and myarray[1] <= 12:
    print(ans1)
else:
  print(ans4)

Submission status: Wrong Answer

Solution code:
S = list(input())

ans1 = 'YYMM'
ans2 = 'MMYY'
ans3 = 'AMBIGUOUS'
ans4 = 'NA'

myarray = []
myarray.append(int(S[0]+ S[1]))
myarray.append(int(S[2]+ S[3]))

if myarray[0] >=1 and myarray[1] >= 1:
  if myarray[0] >= 12 and myarray[1] >= 12:
    print(ans4) 
  if myarray[0] <= 12 and myarray[1] <= 12:
    print(ans3)
  if myarray[0] <= 12 and myarray[1] > 12:
    print(ans2)
  if myarray[0] > 12 and myarray[1] <= 12:
    print(ans1)
else:
  print(ans4)

Submission status: Wrong Answer

Solution code:
a = int(input())  # 数値入力
b = a%100
a = int(a/100)

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

Submission status: Wrong Answer

Solution code:
a = int(input())  # 数値入力
b = a%100
a = int(a/100)

if a<=12:
    if b<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if b<=12:
        print("YY<<")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
a = int(input())  # 数値入力
b = a%100
a = int(a/100)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
a = int(n[:2])
b = int(n[2:])
if(a >= 13 and b <=12 and b >= 1):
    print("YYMM")
elif(a <= 12 and b >= 13 and a >= 1):
    print("MMYY")
elif((a <= 12 and b <= 12 and a >= 1 and b >= 1) or (a >= 13 and b >= 13)):
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
n = input()
a = int(n[:2])
b = int(n[2:])
print(a)
print(b)
if(a >= 13 and b <=12 and b >= 1):
    print("YYMM")
elif(a <= 12 and b >= 13 and a >= 1):
    print("MMYY")
elif((a <= 12 and b <= 12 and a >= 1 and b >= 1) or (a >= 13 and b >= 13)):
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())

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

Submission status: Wrong Answer

Solution code:
s = str(input())

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

Submission status: Wrong Answer

Solution code:
S = list(map(int,list(input())))

A = 10*S[0]+S[1]
B = 10*S[2]+S[3]

if 1<=A<= 12:
    if 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 -*-

def main():
	s = input()
	first = int(s[:2])
	second = int(s[2:])

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


if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
S = input()

a = int(S[:2])
b = int(S[2:])
a = True if a>0 and a<13 else False
b = True if b>0 and b<13 else False

if a and b:
  str = 'ANBIGUOUS'
elif a and not b:
  str = 'MMYY'
elif not a and b:
  str = 'YYMM'
else:
  str = 'NA'
  
print(str)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 入力割当
S = str(input())
S1 = int(S[:2])
S2 = int(S[3:])

# 判定
if 1 <= S1 <= 12 and 1 <= S2 <= 12:
	ans = 'AMBIGUOUS'
elif 1 <= S1 <= 12 and (S2 == 0 or 13 <= S2):
	ans = 'MMYY'
elif 1 <= S2 <= 12 and (S1 == 0 or 13 <= S1):
	ans = 'YYMM'
else:
	ans = 'NA'

# 結果表示
print(ans)

Submission status: Wrong Answer

Solution code:
A=input()
B,C=int(A[0:2]),int(A[2:4])
if 1<=B<=12 and 1<=C<=12:
    print("AMBIGIOUS")
elif 1<=B<=12:
    print("MMYY")
elif 1<=C<=12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
A=input()
B,C=int(A[0:2]),int(A[2:4])
if 1<=B<=12 and 1<=C<=12:
    print("AMBIGIOUS")
elif 1<=B<=12:
    print("MMYY")
elif 1<=C<=12:
    print("YYMM")
else:
    print("None")

Submission status: Wrong Answer

Solution code:
s=list(input())
d=int(s[0]+s[1])
f=int(s[2]+s[3])
i=0
if d>12:
    i+=10
elif f>12:
    i+=1

if d==0 or f==0:
    print("NA")
elif i==10:
    print("YYMM")
elif i==1:
    print("MMYY")
elif i==0:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
letter = input()
_b2 = int(letter[:2])
_a2 = int(letter[2:4])
if _b2 > 12 & _a2 > 12:
    print("NA")
elif _b2 > 12 & _a2 <= 12:
    if _a2 == 0: print("NA")
    else: print("YYMM")
elif _b2 <= 12 & _a2 > 12:
    if _b2 == 0: print("NA")
    else: print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2]) > 13 or s[:2]=="00"
b = int(s[2:]) >13 or s[2:]=="00"
if a and b:
  print("NA")
if not a and not b:
  print("AMBIGUOUS")
if not a and b:
  print("MMYY")
if a and not b:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2]) > 13 or int(s[:2])==0
b = int(s[2:]) >13 or int(s[2:])==0
if a and b:
  print("NA")
if not a and not b:
  print("AMBIGUOUS")
if not a and b:
  print("MMYY")
if a and not b:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2]) > 13
b = int(s[2:]) > 13
if not a and not b:
  print("AMBIGUOUS")
if a and b:
  print("NA")
if not a and b:
  print("MMYY")
if a and not b:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2]) > 13
b = int(s[2:]) > 13
if a and b:
  print("AMBIGUOUS")
if not a and not b:
  print("NA")
if not a and b:
  print("MMYY")
if a and not b:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
# -*- Coding: utf-8 -*-
import numpy as np
S = raw_input()
first  = int(S[:2])
second = int(S[2:])

if first==0:
    if (second==0)|(second>=13):
        print "NA"
    else:
        print "YYMM"
elif (first>0) & (first<13):
    if (second > 0) & (second<13):
        print "AMBIGUOUS"
    else:
        print "MMYY"
else:
    if second == 0:
        print "NA"
    if (second>0) & (second<13):
        print "YYMM"

Submission status: Wrong Answer

Solution code:
# -*- Coding: utf-8 -*-
import numpy as np
S = raw_input()
first  = int(S[:2])
second = int(S[2:])

if first==0:
    if (second==0)|(second>=13):
        print "NA"
    else:
        print "YYMM"
elif (first>0) & (first<13):
    if (second > 0) & (second<13):
        print "ANBIGUOS"
    else:
        print "MMYY"
else:
    if second == 0:
        print "NA"
    if (second>0) & (second<13):
        print "YYMM"

Submission status: Wrong Answer

Solution code:
S = list(input())
A = int("".join([S[0],S[1]]))
B = int("".join([S[2],S[3]]))


if 1 <= A <= 12:
    if 1 <= B <= 12:
        print("AMBIGUOS")
    else:
        print("MMYY")
else:
    if 1 <= B <= 12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
A = int("".join([S[0],S[1]]))
B = int("".join([S[2],S[3]]))


if 0 < A < 13:
    if 0 < B < 13:
        print("AMBIGUOS")
    else:
        print("MMYY")
else:
    if 0 < B < 13:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
A = int("".join([S[0],S[1]]))
B = int("".join([S[2],S[3]]))

if (0 < A < 13) and (0 < B < 13):
    print("AMBIGUOS")
elif (0 < A < 13):
    print("MMYY")
elif (0 < B < 13):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
A = int("".join([S[0],S[1]]))
B = int("".join([S[2],S[3]]))

if (0 < A < 13) and (0 < B < 13):
    print("AMBIGUOS")
elif (0 < A < 13) and (B > 12 or B == 0):
    print("MMYY")
elif (A > 12 or A == 0) and (0 < B < 13):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
A = int("".join([S[0],S[1]]))
B = int("".join([S[2],S[3]]))

if (A > 12 or A == 0) and (B > 12 or B == 0):
    print("NA")
elif (0 < A < 13) and(B > 12 or B == 0):
    print("MMYY")
elif (A > 12 or A == 0) and (0 < B < 13):
    print("YYMM")
else:
    print("AMBIGUOS")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

def exammonth(c):
    if 0 < c and c < 13:
        return 1
    else:
        return 0

def examyear(c):
    if c == 0:
        return 0
    else:
        return 1


if examyear(int(S[0:2])) == 1 and exammonth(int(S[2:4])) == 1:
    if exammonth(int(S[0:2])) == 1 and examyear(int(S[2:4])) == 1:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    if exammonth(int(S[0:2])) == 1 and examyear(int(S[2:4])) == 1:
        print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

def exammonth(c):
    if 0 < c and c < 13:
        return 1
    else:
        return 0

def examyear(c):
    if c == 0:
        return 0
    else:
        return 1

if examyear(int(S[0:3])) == 1 and exammonth(int(S[3:5])) == 1:
    if exammonth(int(S[0:3])) == 1 and examyear(int(S[3:5])) == 1:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    if exammonth(int(S[0:3])) == 1 and examyear(int(S[3:5])) == 1:
        print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

def exammonth(c):
    if 0 < c and c < 13:
        return 1
    else:
        return 0

def examyear(c):
    if c == 00:
        return 0
    else:
        return 1

if examyear(int(S[0:3])) == 1 and exammonth(int(S[3:5])) == 1:
    if exammonth(int(S[0:3])) == 1 and examyear(int(S[3:5])) == 1:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    if exammonth(int(S[0:3])) == 1 and examyear(int(S[3:5])) == 1:
        print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
# stdin = open('./input.txt')
l = stdin.readline().rstrip()
month_possible = ['01','02','03','04','05','06','07','08','09','10','11','12']
year_possible = ['00']

fo = ''.join(l[0:2])
la = ''.join(l[2:])
if int(fo) == 0 or int(la) == 0:
    print("NA")
    exit(0)
if 0 < int(fo) <= 12:
    if 0 < int(la) <= 12:
        print("AMBIGUOUS")
    elif 0 < int(la) < 100:
        print("MMYY")
    else:
        print("NA")
else:
    if 0 < int(la) <= 12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
import re
import sys
input = sys.stdin.readline

s = input()
a = '[0][1-9]' if '0' in s[0] else '[1][0-2]'
b = '[0][1-9]' if '0' in s[2] else '[1][0-2]'
if '00' not in s[0:2] and re.search(b,s[2:4]):
    if '00' not in s[2:4] and re.search(a,s[0:2]):
        ans = 'AMBIGUOUS'
    else:
        ans = 'YYMM'
elif '00' not in s[2:4] and re.search(a,s[0:2]):
    ans = 'MMYY'
else:
    ans = 'NA'
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin
# stdin = open('./input.txt')
l = stdin.readline().rstrip()
month_possible = ['01','02','03','04','05','06','07','08','09','10','11','12']
year_possible = ['00']

fo = ''.join(l[0:2])
la = ''.join(l[2:-1])

if int(fo) == 0 or int(la) == 0:
    print("NA")
    exit(0)
if 0 < int(fo) <= 12:
    if 0 < int(la) <= 12:
        print("AMBIGUOUS")
    elif 0 < int(la) < 100:
        print("MMYY")
    else:
        print("NA")
else:
    if 0 < int(la) <= 12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
import re
import sys
input = sys.stdin.readline

s = input()
a = '[0][1-9]' if '0' in s[0] else '[1][0-2]'
b = '[0][1-9]' if '0' in s[2] else '[1][0-2]'
if '0' not in s[1] and re.search(b,s[2:4]):
    if '0' not in s[3] and re.search(a,s[0:2]):
        ans = 'AMBIGUOUS'
    else:
        ans = 'YYMM'
elif '0' not in s[3] and re.search(a,s[0:2]):
    ans = 'MMYY'
else:
    ans = 'NA'
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()


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

Submission status: Wrong Answer

Solution code:
S = [i for i in input()]
mae = S[0]+S[1]
ushiro = S[2]+S[3]
mmyy = False
yymm = False
if int(mae)>0 and int(mae)<=12:
    mmyy = True
elif int(ushiro)>0 and int(ushiro)<=12:
    yymm = True

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

Submission status: Wrong Answer

Solution code:
S = [i for i in input()]
mae = S[0]+S[1]
ushiro = S[2]+S[3]
mmyy = False
yymm = False
if int(mae)>0 and int(mae)<=12:
    mmyy = True
elif int(ushiro)>0 and int(ushiro)<=12:
    yymm = True

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

Submission status: Wrong Answer

Solution code:
S = [i for i in input()]
mae = S[0]+S[1]
ushiro = S[2]+S[3]
mmyy = False
yymm = False
if int(mae)>0 and int(mae)<=12:
    mmyy = True
elif int(ushiro)>0 and int(ushiro)<=12:
    yymm = True

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

Submission status: Wrong Answer

Solution code:
S = [i for i in input()]
mae = S[0]+S[1]
ushiro = S[2]+S[3]
if int(mae)>0 and int(ushiro)>0 and int(mae)<=12 and int(ushiro)<=12:
    print("AMBIGUOUS")
elif int(mae)>0 and int(mae)<=12 and int(ushiro)>12:
    print("MMYY")
elif int(ushiro)>0 and int(mae)>12 and int(ushiro)<=12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = [i for i in input()]
mae = S[0]+S[1]
ushiro = S[2]+S[3]
if int(mae)>0 and int(ushiro) and int(mae)<=12 and int(ushiro)<=12:
    print("AMBIGUOUS")
elif int(mae)>0 and int(mae)<=12 and int(ushiro)>12:
    print("MMYY")
elif int(ushiro)>0 and int(mae)>12 and int(ushiro)<=12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S=int(input())

a=S/100
b=S%100

if((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:
S = list(map(int, input()))

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

Submission status: Wrong Answer

Solution code:
S = list(map(int, input()))

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

print(ans)

Submission status: Wrong Answer

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

if a == 0:
  i = ""
elif 1 <= a <= 12:
  i = "MM"
else:
  i = "YY"
    
if b == 0:
  j = ""
elif 1 <= b <= 12:
  j = "MM"
else:
  j = "YY"
      
if i + j == "MMMM":
  print("AMBIGUOUS")
elif i + j == "MMYY":
  print("MMYY")
elif i + j == "YYMM":
  print("YYMM")  
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=list(input())
f=[s[0],s[1]]
b=[s[2],s[3]]
if f[0]=="0":
  f.pop(0)
if b[0]=="0":
  b.pop(0)
w="".join(f)
k="".join(b)
g=[int(n) for n in w]
c=[int(n) for n in k]
v=(g[0]*10)+g[1] if len(g)==2 else g[0]
x=(c[0]*10)+c[1] if len(c)==2 else c[0]
print(("AMBIGIOUS" if 1<=x<=12 else "MMYY") if 1<=v<=12 else ("YYMM" if 1<=x<=12 else "NA"))

Submission status: Wrong Answer

Solution code:
s=list(input())
f=[s[0],s[1]]
b=[s[2],s[3]]
if f[0]=="0":
  f.pop(0)
if b[0]=="0":
  b.pop(0)
w="".join(f)
k="".join(b)
g=[int(n) for n in w]
c=[int(n) for n in k]
v=(g[0]*10)+g[1] if len(g)==2 else g[0]
x=(c[0]*10)+c[1] if len(c)==2 else c[0]
r=("AMBIGIOUS" if 1<=x<=12 else "MMYY") if 1<=v<=12 else ("YYMM" if 1<=x<=12 else "NA")
print(r)

Submission status: Wrong Answer

Solution code:
S = input()

Y = int(S[:2])
M = int(S[2:])

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

Submission status: Wrong Answer

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


def solve(S: int):
    a= S//100
    b= S % 100
    if a==0 or b==0:
        print("NA")
        exit()
    if a>=13:
        if b >=13:
            print("NA")
            exit()
        else:
            print("YYMM")
            exit()
    else:
        if 1<=b<=12:
            print("AMBIGUOUS")
            exit()
        else:
            print("MMYY")
            exit()
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = int(next(tokens))  # type: int
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if 1<=s1 and s1<=12:
    if 1<=s2 and s2<=99:
        if 1<=s2 and s2<=12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        print("NA")
else:
    if 1<=s1 and s1<=99:
        if 1 <= s2 and s2 <= 12:
            print("YYMM")
        else:
            print("NA")
    else:
        if 1 <= s2 and s2 <= 12:
            print("YYMM")
        else:
            print("NA")

Submission status: Wrong Answer

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

if 1<=s1 and s1<=12:
    if 1<=s2 and s2<=99:
        if 1<=s2 and s2<=12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        print("NA")
else:
    if 1<=s1 and s1<=99:
        if 1 <= s2 and s2 <= 12:
            print("YYMM")
        else:
            print("NA")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:

import sys

def check_YYMMorMMYY(str_date):
    str1=str_date[:2]
    str2=str_date[2:]
    num1=int(str1)
    num2=int(str2)
    if 1<=num1<=12 and 1<=num2<=12:
        print("AMBIGUOUS")
    elif 13<=num1<=99 and 1<=num2<=12:
        print("YYMM")
    elif 1<=num1<=12 and 13<=num2<=99:
        print("MMYY")
    elif 13<=num1<=99 and 13<=num2<=99:
        print("NA")
    elif num1==0 or num2==0:
        print("NA")

str_S=input()


if str_S.isdecimal()==0 or len(str_S)!=4 :
    print("Unexpected S")
    sys.exit()

check_YYMMorMMYY(str_S)

Submission status: Wrong Answer

Solution code:
import sys

def check_YYMMorMMYY(str_date):
    str1=str_date[:2]
    str2=str_date[2:]
    num1=int(str1)
    num2=int(str2)
    # print(num1)                                                                          
    # print(num2)                                                                          
    # flagYYMM=0                                                                           
    # flagMMYY=0                                                                           
    if 1<=num1<=12 and 1<=num2<=12:
        print("AMBIGUOUS")
        # flagYYMM=1                                                                       
        # flagMMYY=1                                                                       
    elif 13<=num1<=99 and 1<=num2<=12:
        print("YYMM")
        # flagMMYY=1                                                                       
    elif 1<=num1<=12 and 13<=num2<=99:
        print("MMYY")
        # flagYYMM=1                                                                       
    else:
        print("NA")
    # return flagYYMM,flagMMYY                                                             


str_S=input()


if str_S.isdecimal()==0 or len(str_S)!=4 :
    print("Unexpected S")
    sys.exit()

# print(str_S[:2])                                                                         
# print(str_S[2:])                                                                         

check_YYMMorMMYY(str_S)

Submission status: Wrong Answer

Solution code:
import sys

def check_YYMMorMMYY(str_date):
    str1=str_date[:2]
    str2=str_date[2:]
    num1=int(str1)
    num2=int(str2)
    # print(num1)                                                                          
    # print(num2)                                                                          
    # flagYYMM=0                                                                           
    # flagMMYY=0                                                                           
    if 1<=num1<=12 and 1<=num2<=12:
        print("AMBIGUOUS")
        # flagYYMM=1                                                                       
        # flagMMYY=1                                                                       
    elif 13<=num1<=99 and 1<=num2<=12:
        print("YYMM")
        # flagMMYY=1                                                                       
    elif 1<=num1<=12 and 13<=num2<=99:
        print("MMYY")
        # flagYYMM=1                                                                       
    else:
        print("NA")
    # return flagYYMM,flagMMYY                                                             


str_S=input()

if len(str_S)!=4 :
    print("Unexpected S")
    sys.exit()

# print(str_S[:2])                                                                         
# print(str_S[2:])                                                                         

check_YYMMorMMYY(str_S)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(map(int,input()))
a=s[0]
b=s[1]
c=s[2]
d=s[3]
if a>=1 and b>=3 and 0<(c*10+d)<=12:
    print("YYMM")
elif 0<(a*10+b)<=12 and c>=1 and d>=3:
    print("MMYY")
elif 0<(a*10+b)<=12 and 0<(c*10+d<=12):
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
if int(s[:2]) <=12 and int(s[:2]) > 0:
  if int(s[2:]) <=12 and int(s[2:]) > 0:
  	print('ABMIGUOUS')
  else:
    print('MMYY')
elif int(s[2:]) <=12 and int(s[2:]) > 0:
    if int(s[:2]) <=12 and int(s[:2]) > 0:
      	print('ABMIGUOUS')
    else:
        print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

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

def isMonth(i) :
    if i >= 1 and i <= 12 :
        return True
    else :
        return False

if isMonth(A) and isMonth(B) :
    print('AMBIGUOUS')
elif not isMonth(A) and isMonth(B) :
    print('YYMM')
elif isMonth(B) and not isMonth(B) :
    print('MMYY')
else :
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

#YYMM:西暦下二桁+月
#MMYY:月+西暦下二桁
#AMBIGUOUS:YYMM,MMYYどちらの可能性もある場合
#NA:どちらの可能性も無い場合
l = [int(x) for x in list(str(S))]

#print(l)
a= l[0]*10 + l[1]
#print(a)
b= l[2]*10 + l[3]
#print(b)

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

Submission status: Wrong Answer

Solution code:
S = input()

#YYMM:西暦下二桁+月
#MMYY:月+西暦下二桁
#AMBIGUOUS:YYMM,MMYYどちらの可能性もある場合
#NA:どちらの可能性も無い場合
l = [int(x) for x in list(str(S))]

#print(l)
a= l[0]*10 + l[1]
#print(a)
b= l[2]*10 + l[3]
#print(b)

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

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2])
b = int(s[2:])
if a <= 12:
	if b <=12:
		print('AMBIGUOUS')
	else:
		print('MMYY')
else:
	if b <=12:
		print('YYMM')
	else:
		print('NA')

Submission status: Wrong Answer

Solution code:
ss = input()
s = int(ss)

ue = s // 100
sita = s % 100
if ue > 12:
    if sita <= 12 and sita != 0:
        print("YYMM")
    else:
        print("NA")
elif ue == 0:
    if sita <= 12 and sita != 0:
        print("YYMM")
    else:
        print("NA")
else:
    if sita <= 12 and sita != 0:
        print("AMBIGUOUS")
    elif sita == 0:
        print("MMYY")
    else:
        print("YYMM")