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:
def main():
    S = input()
    if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12:
        return "AMBIGUOUS"
    elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 12 >= int(S[2:]) > 0:
        return "YYMM"
    elif 0 < int(S[:2]) <= 12 and (12 < int(S[2:]) or int(S[2:]) == 0):
        return "MMYY"
    else:
        return "NA"


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()

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

x = 1 <= A <= 99 and 1 <= B <= 12
y = 1 <= A <= 12 and 1 <= B <= 99

if x and y:
    print('AMBIGUOUS')
elif x:
    print('YYMM')
elif y:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
S = list(input())
S = [S[0]+S[1],S[2]+S[3]]
month = ['01','02','03','04','05','06','07','08','09','10','11','12']

# 月表示、年表示についてのステータス
# [前表示、後ろ表示]
mon = [0,0]
yer = [0,0]

if S[0] in month:
	mon[0] = 1
if S[1] in month:
	mon[1] = 1
if S[0] != '00':
	yer[0] = 1
if S[1] != '00':
	yer[1] = 1

# print(mon,yer) 

if yer[0] == 1 and mon[0] == 1 and yer[1] == 1 and mon[1] == 1:
	print('AMBIGUOUS')
	sys.exit()
if yer[0] == 1 and mon[1] == 1:
	print('YYMM')
	sys.exit()
if mon[0] == 1 and yer[1] == 1:
	print('MMYY')
	sys.exit()
else:
	print('NA')
	sys.exit()

Submission status: Wrong Answer

Solution code:
str_MY = input()
int_f = int(str_MY[:2])
int_b = int(str_MY[2:])
if (12<int_f and 0<int_b<13) or (int_f ==0 and 0<int_b<13):
    print('YYMM')
elif (12<int_b and 0<int_f<13) or (int_b ==0 and 0<int_f<13):
    print('YYMM')
elif 0<int_b<13 and 0<int_f<13:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
f,e = int(S[:2]),int(S[2:])
if (f==0 and e>12) or (f>12 and e==0) or (f>12 and e>12):
  print('NA')
if 1<=f<=12 and 1<=e<=12:
    print('AMBIGUOUS')
if 1<=f<=12 and e>12:
    print('MMYY')
if f>12 and 1<=e<=12:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
S = input()
f,e = int(S[:2]),int(S[2:])
if (f==0 and e>12) or (f>12 and e==0) or (f>12 and e>12):
  print('NA')
  exit()
if 1<=f<=12:
  if 1<=e<=12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
elif f>12:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
S = input()
f,e = int(S[:2]),int(S[2:])
if f==0 or e==0 or (f>12 and e>12):
  print('NA')
  exit()
if 1<=f<=12:
  if e>12:
    print('MMYY')
  elif 1<=e<=12:
    print('AMBIGUOUS')
elif f>12:
  if 1<=e<=12:
    print('YYMM')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
f,e = int(S[:2]),int(S[2:])
if f>12:
  if 1<=e<=12:
    print('YYMM')
  else:
    print('NA')
elif 1<=f<=12:
  if e>12:
    print('MMYY')
  elif 1<=e<=12:
    print('AMBIGUOUS')
  else:
    print('NA')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
f,e = int(S[:2]),int(S[2:])
if f>12:
  if 0<e<=12:
    print('YYMM')
  else:
    print('NA')
elif 0<f<=12:
  if e>12:
    print('MMYY')
  elif 0<e<=12:
    print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
f,e = int(S[:2]),int(S[2:])
if f>12:
  if 0<e<=12:
    print('YYMM')
  else:
    print('NA')
elif 0<f<12:
  if e>12:
    print('MMYY')
  else:
    print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
LL,RR = int(S[:2]), int(S[2:])

def v_month(x):
    return  1<=x and x<=12

def v_year(x):
    return 1<=x

m1 = v_month(LL)
y1 = v_year(LL)

m2 = v_month(RR)
y2 = v_year(RR)

if (m1 and y1) and (m2 and y2):
    print("AMBIGUOUS")
elif m1 and y2:
    print("MMYY")
elif y1 and m2:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S=int(input())
A,B=S//100,S%100
print(A,B)
if A < 13 and B < 13 and A != 0 and B != 0:
  print("AMBIGUOUS")
elif A < 13 and A > 0:
  print("MMYY")
elif B < 13 and B > 0:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=int(input())
A,B=S//100,S%100
if A < 1 or B < 1:
  print("NA")
elif A < 13 and B < 13:
  print("AMBIGUOUS")
elif A < 13 and B > 12:
  print("MMYY")
elif A > 12 and B < 13:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
S=int(input())
A,B=S//100,S%100
if A < 1 or B < 1:
  print("NA")
elif A < 13 and B < 13:
  print("AMBIGUOUS")
elif A < 13 and B > 13:
  print("MMYY")
elif A > 13 and B < 13:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
aa = int(s[:2])
bb = int(s[2:])


if 1<=aa and aa<=12:
  if 1<=bb and bb<=12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if 1<bb and bb<=12:
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
aa = int(s[:2])
bb = int(s[2:])

if 0<aa and aa<=12:
  if 0<bb and bb<=12:
    print('AMBIGUOUS')
  elif bb==0:
    print('NA')
  else:
    print('MMYY')
elif aa!=0:
  if 0<bb and bb<=12:
    print('YYMM')
  else:
    print('NA')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
aa = int(s[:2])
bb = int(s[2:])

if 0<aa and aa<=12:
  if 0<bb and bb<=12:
    print('AMBIGUOUS')
  elif bb==0:
    print('NA')
  else:
    print('MMYY')
elif aa!=0:
  if 0<bb and bb<=12:
    print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
aa = int(s[:2])
bb = int(s[2:])

if 0<aa and aa<=12:
  if 0<bb and bb<=12:
    print('AMBIGUOUS')
  elif bb==0:
    print('NA')
  else:
    print('MMYY')
elif 0<bb and bb<=12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
aa = int(s[:2])
bb = int(s[2:])

if 0<aa and aa<=12:
  if 0<bb and bb<=12:
    print('AMBIGUOUS')
  elif bb==0:
    print('NA')
  else:
    print('MMYY')
elif 0<bb and bb<=31:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

if int(s[:2]) > 12:
  if int(s[2:]) == 0:
    print('NA')
  else:
    print('YYMM')
else:
  if int(s[2:]) == 0:
    print('NA')
  else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()

if int(s[:2]) > 12:
  if int(s[2:]) == 0:
    print('NA')
  else:
    print('YYMM')
else:
  if int(s[2:]) == 0:
    print('NA')
  elif int(s[2:]) > 31:
    print('MMYY')
  else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
l=[int(s[0:2]),int(s[2:4])]

if 1 <= l[0] <= 12:
    if 1 <= l[1] <= 12:
        print("AMBIGUOUS")
    elif 13 <= l[1]:
        print("MMYY")
    else:
        print("NA")
elif 13 <= l[0]:
    if 1 <= l[1] <= 12:
        print("YYMM")
    else:
        print("NA")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
S1 = int(S[0:2])
S2 = int(S[2:4])

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

Submission status: Wrong Answer

Solution code:
S = input()
S1 = int(S[0:2])
S2 = int(S[2:4])

if (S1 > 0) and (S2 < 13) and (S1 < 13) and (S2 > 0):
    print("AMBIGUOUS")
elif (S1 > 0) and (S2 < 13) and (S2 > 0):
    print("YYMM")
elif (S1 < 13) and (S2 > 0) and (S1 > 0):
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = "true"
b = "true"
if(int(S[0]+S[1])>12 or int(S[0]+S[1])<=0):
	a = "false"
if(int(S[2]+S[3])>12 or int(S[2]+S[3])<=0):
	b = "false"
if(a == "true" and b == "true"):
	print("AMBIGOUS")
elif(a == "true" and b == "false"):
	print("MMYY")
elif(a == "false" and b == "true"):
	print("YYMM")
elif(a == "false" and b == "false"):
	print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 int(S[0:2]) > 12 and 0 < (int(S[2:4])) <= 12:
    print("YYMM")
elif 0 < int(S[0:2]) <= 12 and int(S[2:4]) > 12:
    print("MMYY")
elif int(S[0:2]) ==  0 and 0 < (int(S[2:4])) <= 12:
    print("YYMM")
elif 0 < int(S[0:2]) <= 12  and 0 < (int(S[2:4])) == 0:
    print("MMYY")
else:
    print("NA")

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 int(S[0:2]) >= 12 and 0 <= (int(S[2:4])) <= 12:
    print("YYMM")
elif 0 < int(S[0:2]) <= 12 and int(S[2:4]) >= 12:
    print("MMYY")
else:
    print("NA")

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 int(S[0:2]) > 12 and 0 < (int(S[2:4])) <= 12:
    print("YYMM")
elif 0 < int(S[0:2]) <= 12 and int(S[2:4]) > 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

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

ans = "NA"
if 1 <= head <= 12:
    if 1 <= tail <= 12:
        ans = "AMBIGUOUS"
    else:
        "MMYY"
elif 1 <= tail <= 12:
    ans = "YYMM"

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

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

ans = "NA"
if 1 <= head <= 12:
    if 1 <= tail <= 12:
        ans = "AMBIGUOUS"
    else:
        "YYMM"
elif 1 <= tail <= 12:
    ans = "MMYY"

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

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

ans = 0

if int(a) <= 12 and int(a) >= 1:
    ans += 2

if int(b) <= 12 and int(b) >= 1:
  ans += 3
  
if ans == 0:
  print("NA")
elif ans == 2:
  print("YYMM")
elif ans == 3:
  print("MMYY")
elif ans == 5:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()

a = s[0:1]
b = s[2:3]

ans = 0

if int(a) <= 12 and int(a) >= 1:
    ans += 2

if int(b) <= 12 and int(b) >= 1:
  ans += 3
  
if ans == 0:
  print("NA")
elif ans == 2:
  print("YYMM")
elif ans == 3:
  print("MMYY")
elif ans == 5:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()

a = s[0:1]
b = s[2:3]

ans = 0

if int(a) <= 12 and int(a) >= 1:
    ans += 2

if int(b) <= 12 and int(b) >= 1:
  ans += 3
  
if ans == 0:
  print("NA")
elif ans == 2:
  print("MMYY")
elif ans == 3:
  print("YYMM")
elif ans == 5:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()

a = s[0:1]
b = s[2:3]

ans = 0

if int(a) <= 12 and int(a) >= 1:
    ans += 2

if int(b) <= 12 and int(b) >= 1:
  ans += 3
  
if ans == 0:
  print("NA")
elif ans == 2:
  print("MMYY")
elif ans == 3:
  print("MMYY")
elif ans == 5:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = list(input())

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

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

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
if a==00 or b==00:
    print("NA")
elif a>12 and b>12:
    print("NA")
elif not a>12 and not b>12:
    print("AMBIGUOUS")
elif a>12 and b!=00:
    print("YYMM")
elif b>12 and a!=00:
    print("MMYY")

Submission status: Wrong Answer

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
a,b = int(s[:2]),int(s[2:])
if a > 12 and  0 < b < 12:
    print('YYMM')
elif (a > 12 and b > 12) or (a == 0 and b > 12) or ( b == 0 and a > 12):
    print('NA')
elif a <= 12 and b > 12:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
a,b = int(s[:2]),int(s[2:])
if a > 12 and  0 < b < 12:
    print('YYMM')
elif a > 12 and b > 12 or (a == 0) or (b == 0):
    print('NA')
elif a <= 12 and b > 12:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
aa = int(s[:2])
bb = int(s[2:])
aa_yy = False
aa_mm = False
bb_yy = False
bb_mm = False
if 1 <= aa:
    aa_yy = True
if 1 <= aa <= 12:
    aa_mm = True
if 1 <= bb:
    bb_yy = True
if 1 <= bb <= 12:
    bb_mm = True
if aa_yy and aa_mm and bb_yy and bb_mm:
    print("AMBIGUOUS")
elif aa_yy and bb_mm:
    print("YYMM")
elif bb_yy and aa_mm:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
N = int(input())
y = [0,1,2,3,4,5,6,7,8,9]
one = [1]
zero = [0]
p = [1,2,3,4,5,6,7,8,9]
q = [0,1,2]
a=N//1000
b=(N - (a * 1000))//100 
c=(N- (a*1000)-(b * 100))// 10
d=(N - (a*1000)-(b*100)-(c*10))

if ((a in one) and (b in q)or(a in zero) and (b in p))and((c in one) and (d in q)or(c in zero)and(d in q)):
  print('AMBIGUOUS')
elif (a in y )and(b in y)and((c in one) and (d in q) or (c in zero) and(d in p)):
  print('YYMM')
elif ((a in one )and(b in q))or((a in zero)and(b in p))and(c in y) and (d in y):
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
N = int(input())
y = [0,1,2,3,4,5,6,7,8,9]
one = [1]
zero = [0]
p = [1,2,3,4,5,6,7,8,9]
q = [0,1,2]
a=N//1000
b=(N - (a * 1000))//100 
c=(N- (a*1000)-(b * 100))// 10
d=(N - (a*1000)-(b*100)-(c*10))

if ((a in one) and (b in q)or(a in zero) and (b in p))and((c in one) and (d in q)or(c in zero)and(d in q)):
  print('AMBIGUOUS')
elif (a in y )and(b in y)and((c in one) and (d in q) or (c in zero) and(d in p)):
  print('YYMM')
elif (((a in one )and(b in q))or((a in zero)and(c in p)))and(c in y) and (d in y):
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
sf=int(S[:3])
sb=int(S[3:])
if 1<=sf and sf<=12:
  if 1<=sb and sb<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1<=sb and sb<=12:
    print("YYMM")
  else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 15:35
def P(s):
    print(s)
    exit(0)

s = input()
mae = int(s[:2])
ato = int(s[2:])
if mae == 0 and ato == 0:
    P("NA")
if mae == 0 and ato != 0:
    P("YYMM")
if mae != 0 and ato == 0:
    P("MMYY")    
if mae > 12:
    if ato <= 12:
        P("YYMM")
    else:
        P("NA")
if ato > 12:
    if mae <= 12:
        P("MMYY")
    else:
        P("NA")
if mae <= 12 and ato <= 12:
    P("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
# 15:35
def P(s):
    print(s)
    exit(0)

s = input()
mae = int(s[:2])
ato = int(s[2:])
if mae == 0 or ato == 0:
    P("NA")
if mae > 12:
    if ato <= 12:
        P("YYMM")
    else:
        P("NA")
if ato > 12:
    if mae <= 12:
        P("MMYY")
    else:
        P("NA")
if mae <= 12 and ato <= 12:
    P("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s=input()
f1=True
f2=True
if int(s[:2])==0 or int(s[:2])>12:
    f1=False
if int(s[2:])==0 or int(s[2:])>12:
    f2=False
if f1 and f2:
    print("AMBIGOUS")
elif f1:
    print("YYMM")
elif f2:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
f1=True
f2=True
if int(s[:2])==0 or int(s[:2])>12:
    f1=False
if int(s[2:])==0 or int(s[2:])>12:
    f2=False
if f1 and f2:
    print("AMBIGOUS")
elif f1:
    print("MMYY")
elif f2:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
s1 = int("".join(s[0:2]))
s2 = int("".join(s[2:4]))
result = ""

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

Submission status: Wrong Answer

Solution code:
#ABC-126-B
# S = input()
# first = int(S[0]+S[1])
# second = int(S[2]+S[3])
S = [x for x in input()]
first = int(S[0]+""+S[1])
second = int(S[2]+""+S[3])

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

Submission status: Wrong Answer

Solution code:
S = input()
first = int(S[0]+S[1])
second = int(S[2]+S[3])

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

Submission status: Wrong Answer

Solution code:
#ABC-126-B
S = input()
first = int(S[0]+S[1])
second = int(S[2]+S[3])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if 1 <= B <= 12:
    YYMM = True

if 1 <= A <= 12:
    MMYY = True

if YYMM and MMYY:
    print('AMBIGUOS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
if a==00 or b==00:
    print("NA")
elif a>12 and b>12:
    print("NA")
elif not a>12 and not b>12:
    print("AMBIGUOUS")
elif a>=12 and b!=00:
    print("YYMM")
elif b>=12 and a!=00:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
my=0
na=["NA","","AMBIGUOUS"]
#print("s[0,1]=",a,"s[2,3]=",b)
if a==00 or b==00:
    print("NA")
elif a>12 and b>12:
    print("NA")
elif not a>12 and not b>12:
    print("AMBIGUOUS")
elif a>=12 and b!=00:
    print("YYMM")
elif b>=12 and a!=00:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
my=0
na=["NA","","AMBIGUOUS"]
#print("s[0,1]=",a,"s[2,3]=",b)
if a==00 or b==00:
    print("NA")
elif a>12 and b>12:
    print("NA")
elif not a>=12 and not b>=12:
    print("AMBIGUOUS")
elif a>=12 and b!=00:
    print("YYMM")
elif b>=12 and a!=00:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
sl = int(s[0:2])
sr = int(s[3:5])
if 1<= sl <= 12:
  if 1 <= sr <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1 <= sr <= 12:
    print("YYMM")
  else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
if a==00 or b==00:
    print("NA")
elif a>=12 and b>=12:
    print("NA")
elif not a>=12 and b>=12:
    print("AMBIGUOUS")
elif a>=12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
my=0
na=["NA","","AMBIGUOUS"]
#print("s[0,1]=",a,"s[2,3]=",b)
if a==00 or b==00:
    print("NA")
elif a>=12 and b>=12:
    print("NA")
elif not a>=12 and b>=12:
    print("AMBIGUOUS")
elif a>=12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
sl = int(s[0:2])
sr = int(s[3:5])
if 1 <= sl <= 12 and 1 <= sr <= 12:
  print("AMBIGUOUS")
# elif  sl > 12 and sr == 0 or sr > 31 and sr < 0:
#   print("NA")
elif 12 < sr or sr == 0:
  print("MMYY")
elif 12 < sl or sl == 0:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
sl = int(s[0:2])
sr = int(s[3:5])
if 1 <= sl <= 12 and 1 <= sr <= 12:
  print("AMBIGUOUS")
elif  sl > 12 and sr == 0 or sr > 31 and sr < 0:
  print("NA")
elif 12 < sr or sr == 0:
  print("MMYY")
elif 12 < sl or sl == 0:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
my=0
na=["NA","","AMBIGUOUS"]
#print("s[0,1]=",a,"s[2,3]=",b)
if a==00 or b==00:
    print("NA")
elif a>=12 and b>=12:
    print("NA")
elif not a>=12 and not b>=12:
    print("AMBIGUOUS")
elif a>=12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
a = input()
a1 = int(a[:2])
a2 = int(a[2:])
if a1 <= 12 and a2 <= 12:
    print('AMBIGUOUS')
elif a1 <= 12:
    print('MMYY')
elif a2 <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
yymmcount=0
mmyycount=0
my=0
na=["NA","","AMBIGUOUS"]
#print("s[0,1]=",a,"s[2,3]=",b)
if a==00 or b==00:
    print("NA")
else:
    if b<=12 and a!=00:
        print("YYMM")
        my+=1
    else:
        if a<=12 and b!=00:
            print("MMYY")
            my+=1
        else:
            c=na[my]
            print(c)

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
yymmcount=0
mmyycount=0
my=0
na=["NA","","AMBIGUOUS"]
#print("s[0,1]=",a,"s[2,3]=",b)
if a==00 or b==00:
    print("NA")
else:
    if a<=12 and b!=00:
        yymmcount+=1
        my+=1
    if b<=12 and a!=00:
        mmyycount+=1
        my+=1
    if yymmcount==1 and mmyycount==0:
        print("YYMM")
    else:
        if mmyycount==1 and yymmcount==0:
            print("MMYY")
        else:
            c=na[my]
            print(c)

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
yymmcount=0
mmyycount=0
my=0
na=["NA","","AMBIGUOUS"]
#print("s[0,1]=",a,"s[2,3]=",b)
if a==00 or b==00:
    print("NA")
else:
    if b<=12 and a!=00:
        yymmcount+=1
        my+=1
    if a<=12 and b!=00:
        mmyycount+=1
        my+=1
    if yymmcount==1 and mmyycount==0:
        print("YYMM")
    else:
        if mmyycount==1 and yymmcount==0:
            print("MMYY")
        else:
            c=na[my]
            print(c)

Submission status: Wrong Answer

Solution code:
s=list(input())
a=s[0],s[1]
b=s[2],s[3]
a="".join(a);a=int(a)
b="".join(b);b=int(b)
yymmcount=0
mmyycount=0
my=0
na=["NA","","AMBIGUOUS"]
#print("s[0,1]=",a,"s[2,3]=",b)
if b<=12 and a!=00:
    yymmcount+=1
    my+=1
if a<=12 and b!=00:
    mmyycount+=1
    my+=1
if yymmcount==1 and mmyycount==0:
    print("YYMM")
else:
    if mmyycount==1 and yymmcount==0:
        print("MMYY")
    else:
        c=na[my]
        print(c)

Submission status: Wrong Answer

Solution code:
import sys
s = input()

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

is_yymm = False
is_mmyy = False

if l < 1 or 99 < l or r < 1 or 99 < r:
  print('NA')
  sys.exit()

if 1 <= l and l <= 12:
  is_mmyy = True

if 1 <= r and r <= 12:
  is_yymm = True

if is_mmyy and is_yymm:
  print('AMBIGUOUS')
elif is_mmyy:
  print('MMYY')
elif is_yymm:
  print('YYMM')

Submission status: Wrong Answer

Solution code:
S = str(input())

ff = int(S[0])*10 + int(S[1])
bb = int(S[2])*10 + int(S[3])

if ff <= 12 and bb <= 12:
  print('AMBIGUOUS')
elif ff <= 12 and ff >= 1:
  print('MMYY')
elif bb <= 12 and bb >= 1:
  print('YYMM')
else:
  print('NA')

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  :
  print('MMYY')
else:
  print('YYMM')