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

s1 = S[0] + S[1]
s2 = S[2] + S[3]


if int(s1) > 12 and int(s2) > 12:
    print("NA")

elif 1 <= int(s1) <= 12 and int(s2) > 12:
    print("MMYY")

elif 1 <= int(s2) <= 12 and int(s1) > 12:
    print("YYMM")

else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()

s1 = S[0] + S[1]
s2 = S[2] + S[3]


if int(s1) > 12 and int(s2) > 12:
    print("NA")

elif int(s1) <= 12 and int(s2) > 12:
    print("MMYY")

elif int(s2) <= 12 and int(s1) > 12:
    print("YYMM")

else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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()
fo=s[0:2]
la=s[2:]
n=int(fo)
m=int(la)
a=(n<13) and (n>0)
b=(m<13) and (n>0)
ans='NA'
if a and b:
  ans='AMBIGUOS'
elif a and not b:
  ans='MMYY'
elif not a and b:
  ans='YYMM'
else:
  ans='NA'
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
fo=s[0:2]
la=s[2:]
n=int(fo)
m=int(la)
a=(n<13) and (n>0)
b=(m<13) and (n>0)
ans='NA'
if a and b:
  ans='AMBIGOUS'
elif a and not b:
  ans='MMYY'
elif not a and b:
  ans='YYMM'
else:
  ans='NA'
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
fo=s[0:2]
la=s[2:]
n=int(fo)
m=int(la)
a=n<13
b=m<13
ans='NA'
if a and b:
  ans='AMBIGUOS'
elif a and not b:
  ans='MMYY'
elif not a and b:
  ans='YYMM'
else:
  ans='NA'
print(ans)

Submission status: Wrong Answer

Solution code:
print("NA")

Submission status: Wrong Answer

Solution code:
print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
import sys

s=input()

chars2=[int(s[i: i+2])for i in range(0,len(s),2)]

if (chars2[0]>0 and  chars2[0]<13):
    if (chars2[1]>0 and  chars2[1]<13):
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if (chars2[1]>0 and  chars2[1]<13):
        print('YYMM')
    else:
        print('NS')

Submission status: Wrong Answer

Solution code:
from sys import stdin
s = stdin.readline().rstrip()
bef = s[:2]
aft = s[2:]

if bef == '00':
    if aft == '00':
        print('NA')
    elif int(aft) > 0 and int(aft) < 13:
        print('YYMM')
    else:
        print('NA')
elif int(bef) > 0 and int(bef) < 13:
    if aft == '00':
        print('MMYY')
    elif int(aft) > 0 and int(aft) < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if aft == '00':
        print('NA')
    elif int(aft) > 0 and int(aft) < 13:
        print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
inputS = input()
s = inputS

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

Submission status: Wrong Answer

Solution code:
inputS = input()
s = inputS

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

Submission status: Wrong Answer

Solution code:
S = int(input())
if (S // 100 > 12 or S // 100 == 0) and S % 100 > 12:
  print('NA')
elif (S // 100 > 12 or S // 100 == 0) and 1 <= S % 100 <= 12:
  print('YYMM')
elif 1 <= S // 100 <= 12 and (S % 100 > 12 or S % 100 == 0):
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = int(input())
if (S // 100 > 12 or S == 0) and S % 100 > 12:
  print('NA')
elif (S // 100 > 12 or S == 0) and 1 <= S % 100 <= 12:
  print('YYMM')
elif 1 <= S // 100 <= 12 and (S % 100 > 12 or S == 0):
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = int(input())
if S // 100 > 12 and S % 100 > 12:
  print('NA')
elif S // 100 > 12 and S % 100 <= 12:
  print('YYMM')
elif S // 100 <= 12 and S % 100 > 12:
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = int(input())

x = s // 100
y = s % 100

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

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])

if(s1>=1 and s1<=12):
  if(s2>=1 and s2<=12):
    print("AMBIGIOUS\n")
  else:
    print("MMYY\n")
else:
  if(s2>=1 and s2<=12):
    print("YYMM\n")
  else:
    print("NA\n")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])


if(s1>=1 and s1<=12) and (s2>=1 and s2<=12):
  print("AMBIGUOUS\n")
elif((s1>=1 and s1<=12) and s2>12):
  print("MMYY\n")
elif(s1>12 and (s2<=12 and s2>=1)):
  print("YYMM\n")
else:
  print("NA\n")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])
print(s1)
print(s2)

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

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])
print(s1)
print(s2)

if(s1>=1 and s1<=12) and (s2>=1 and s2<=12):
  print("AMBIGUOUS\n")
elif((s1>=1 and s1<=12) and s2>12):
  print("MMYY\n")
elif(s1>12 and (s2<=12 and s2>=1)):
  print("YYMM\n")
else:
  print("NA\n")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a == 0 and b == 0:
    ans = "NA"
elif a > 12 and b == 0:
    ans = "NA"
elif a == 0 and b > 12:
    ans = "NA"
elif a > 12 and b > 12:
    ans = "NA"
elif a > 12 and b < 13 and b != 0:
    ans = "YYMM"
elif a < 13 and b > 12 and a != 0:
    ans = "MMYY"
else:
    ans = "AMBIGUOUS"

print(ans)

Submission status: Wrong Answer

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

if a == 0 and b == 0:
    ans = "NA"
elif a > 12 and b == 0:
    ans = "NA"
elif a == 0 and b > 12:
    ans = "NA"
elif a > 12 and b > 12:
    ans = "NA"
elif a < 13 and b < 13 and a != 0 and b != 0:
    ans = "AMBIGUOUS"
else:
    ans = s[2]+s[3]+s[0]+s[1]

print(ans)

Submission status: Wrong Answer

Solution code:
#abc126b

s=raw_input()
s1=s[:2]
s2=s[2:]
if 0<int(s1)<=12 and 12<int(s2):
 print 'MMYY'
elif int(s1)>12 and 0<int(s2)<13:
 print 'YYMM'
elif s1=='00' and 12<int(s2):
 print 'NA'
elif int(s1)>12 and s2=='00':
 print 'NA'
else:
 print 'AMBIGUOUS'

Submission status: Wrong Answer

Solution code:
#abc126b

s=raw_input()
s1=s[:2]
s2=s[2:]
print s1,s2
if 0<int(s1)<=12 and 12<int(s2):
 print 'MMYY'
elif int(s1)>12 and 0<int(s2)<13:
 print 'YYMM'
elif s1=='00' and 12<int(s2):
 print 'NA'
elif int(s1)>12 and s2=='00':
 print 'NA'
else:
 print 'AMBIGUOUS'

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    n1, n2 = int(s[:2]), int(s[2:])

    if 0 < n1 < 13 and 0 < n2 < 13:
        print('AMBIGUOUS')
    elif n1 == 0 or n2 == 0:
        print('NA')
    elif 0 < n1 < 13 or 0 < n2 < 13:
        print('YYMM')
    else:
        print('NA')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = list(input())
head = int(n[0]+n[1])
tail = int(n[2]+n[3])
if 12 < head <=99 and 0< tail <= 12 :
	print("YYMM")
elif 0<head<=12 and 12<tail<=99 :
	print("MMYY")
elif 0<head<=12 and 0<tail<=12 :
	print("AMBIGUOUS")
else :
	print("NA")

Submission status: Wrong Answer

Solution code:
n = list(input())
head = int(n[0]+n[1])
tail = int(n[2]+n[3])
if 12 < head <=99 and 0< tail <= 12 :
	print("YYMM")
elif 0<head<=12 and 12<tail<=99 :
	print("MMYY")
elif 0<=head<=12 and 0<=tail<=12 :
	print("AMBIGUOUS")
else :
	print("NA")

Submission status: Wrong Answer

Solution code:
import sys

S = input()
mon30 = ["02","04","06","09","11"]
mon31 = ["01","03","05","07","08","10","12"]

f_yymm = 0
f_mmyy = 0

if (S[0]+S[1]) in mon30 and  int(S[2]+S[3]) <= 30:
	f_yymm = 1
elif (S[0]+S[1]) in mon31 and  int(S[2]+S[3]) <= 31:
	f_yymm = 1
if (S[2]+S[3]) in mon30 and  int(S[0]+S[1]) <= 30:
	f_mmyy = 1
elif (S[2]+S[3]) in mon31 and  int(S[0]+S[1]) <= 31:
	f_mmyy = 1
if (S[0]+S[1]) == "00" or (S[2]+S[3]) == "00":
	print("NA")
	sys.exit()

if  f_yymm == 1 and f_mmyy == 1:
	print("AMBIGUOUS")
elif f_yymm == 1:
	print("YYMM")
elif f_mmyy == 1:
	print("MMYY")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
import sys

S = input()
mon30 = ["02","04","06","09","11"]
mon31 = ["01","03","05","07","08","10","12"]

f_yymm = 0
f_mmyy = 0

if (S[0]+S[1]) in mon30 and  int(S[2]+S[3]) <= 30:
	f_yymm = 1
elif (S[0]+S[1]) in mon31 and  int(S[2]+S[3]) <= 31:
	f_yymm = 1
if (S[2]+S[3]) in mon30 and  int(S[0]+S[1]) <= 30:
	f_mmyy = 1
elif (S[2]+S[3]) in mon31 and  int(S[0]+S[1]) <= 31:
	f_mmyy = 1
if (S[0]+S[1]) == "00" or (S[2]+S[3]) == "00":
	print("NA")
	sys.exit()

print(f_yymm,f_mmyy)

if  f_yymm == 1 and f_mmyy == 1:
	print("AMBIGUOUS")
elif f_yymm == 1:
	print("YYMM")
elif f_mmyy == 1:
	print("MMYY")

Submission status: Wrong Answer

Solution code:
S = int(input())
XX = S // 100
YY = S % 100

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

Submission status: Wrong Answer

Solution code:
S = int(input())
XX = S // 100
YY = S % 100

if   0<=XX<=12 and 0 <= YY <= 12:print("AMBIGUOUS")
elif 0<=XX<=99 and 0 <= YY <= 12:print("YYMM")
elif 0 <= XX <= 12 and 0 <= YY <= 99:print("MMYY")
else :print("NA")

Submission status: Wrong Answer

Solution code:
num = int(input())

a = num // 10
b = num % 10

if(a >= 0 and a <= 12 and b >= 0 and b <=12):
    print('AMIGUOUS\n')
elif(a >= 0 and a <= 12):
    print('YYMM\n')
elif(b >= 0 and b <= 12):
    print('MMYY\n')
else:
    print('NA\n')

Submission status: Wrong Answer

Solution code:
inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

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

Submission status: Wrong Answer

Solution code:
inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

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

Submission status: Wrong Answer

Solution code:
inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

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

Submission status: Wrong Answer

Solution code:
inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

if 0<= former <=12 and 0<= latter <=12:
	print("AMBIGUOUS")
elif 0<= former <=12 and 12< latter:
	print("MMYY")
elif 0<= latter <=12 and 12< former:
	print("YYMM")

else:
	print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

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

Submission status: Wrong Answer

Solution code:
str     = input()

input   = int(str)

if input < 100:
    if input < 13:
        out = 'YYMM'
    else:
        out = 'NA'
elif input < 1300:
    if input % 100 == 0:
        out = 'MMYY'
    elif input%100 < 13:
        out = 'AMBIGUOUS'
    else:
        out = 'MMYY'
elif input%100==0:
    out = 'NA'
elif input%100<13:
    out = 'YYMM'
else:
    out = 'NA'
print(out)

Submission status: Wrong Answer

Solution code:
str     = input()

input   = int(str)

if input < 100:
    if input < 13:
        out = 'YYMM'
    else:
        out = 'NA'
elif input < 1300:
    if input % 100 == 0:
        out = 'MMYY'
    elif input%100 < 13:
        out = 'AMBIGUOUS'
    else:
        out = 'MMYY'
elif input%100==0:
    out = 'NA'
elif input%100<13:
    out = 'YYMM'
else:
    out = 'NA!'
print(out)

Submission status: Wrong Answer

Solution code:
S = input()

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

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

Submission status: Wrong Answer

Solution code:

S = input()

uS = S[:2]
lS = S[2:]

uNum = int(uS)
lNum = int(lS)

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

Submission status: Wrong Answer

Solution code:
S = input()

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

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

Submission status: Wrong Answer

Solution code:
S = input()

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

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

Submission status: Wrong Answer

Solution code:
S = input()

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

print(s1, s2)

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

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

print(s1, s2)

if(s1 > 32):
    print('YYMM')
elif(s2 > 32):
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

S = input()

uS = S[:2]
lS = S[2:]

uNum = int(uS)
lNum = int(lS)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

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

# print(A)
# print(B)

flag_YYMM = 0
flag_MMYY = 0

if 1 <= A and A <= 12 and 1 <= B and B <= 19: 
    flag_MMYY = 1
if 1 <= B and B <= 12 and 1 <= A and A <= 19: 
    flag_YYMM = 1
    
if flag_YYMM == 0 and flag_MMYY == 0 : 
    print("NA")
elif flag_YYMM == 0 and flag_MMYY == 1 : 
    print("MMYY")
elif flag_YYMM == 1 and flag_MMYY == 0 : 
    print("YYMM")
elif flag_YYMM == 1 and flag_MMYY == 1 : 
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
if 0 < int(S[:2]) < 13 and 0 < int(S[3:]) < 13:
    print("AMBIGUOUS")
elif 101 <= int(S) <= 1299:
    print("MMYY")
elif 0 < int(S[:2]) and 0 < int(S[3:]) < 13:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
if 0 < int(S[:2]) < 13 and 0 < int(S[3:]) < 13:
    print("AMBIGUOUS")
elif 101 <= int(S) <= 1299:
    print("MMYY")
elif 0 < int(S[:1]) and 0 < int(S[2:]) < 13:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

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

# print(A)
# print(B)

flag_YYMM = 0
flag_MMYY = 0

if 1 <= A and A <= 12 and 1 <= B : 
    flag_MMYY = 1
if 1 <= B and B <= 12 and 1 <= A : 
    flag_YYMM = 1
    
if flag_YYMM == 0 and flag_MMYY == 0 : 
    print("NA")
elif flag_YYMM == 0 and flag_MMYY == 1 : 
    print("MMYY")
elif flag_YYMM == 1 and flag_MMYY == 0 : 
    print("YYMM")
elif flag_YYMM == 1 and flag_MMYY == 1 : 
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()

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

# print(A)
# print(B)

flag_YYMM = 0
flag_MMYY = 0

if 1 <= A and A <= 12 and 1 <= B : 
    flag_MMYY += 1
if 1 <= B and B <= 12 and 1 <= A : 
    flag_YYMM += 1
    
if flag_YYMM == 0 and flag_MMYY == 0 : 
    print("NA")
elif flag_YYMM == 0 and flag_MMYY == 1 : 
    print("MMYY")
elif flag_YYMM == 1 and flag_MMYY == 0 : 
    print("YYMM")
elif flag_YYMM == 1 and flag_MMYY == 1 : 
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()

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

print(A)
print(B)

flag_YYMM = 0
flag_MMYY = 0

if 1 <= A and A <= 12 and 1 <= B : 
    flag_MMYY += 1
if 1 <= B and B <= 12 and 1 <= A : 
    flag_YYMM += 1
    
if flag_YYMM == 0 and flag_MMYY == 0 : 
    print("NA")
elif flag_YYMM == 0 and flag_MMYY == 1 : 
    print("MMYY")
elif flag_YYMM == 1 and flag_MMYY == 0 : 
    print("YYMM")
elif flag_YYMM == 1 and flag_MMYY == 1 : 
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = input()

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

# print(A)
# print(B)

flag_YYMM = 0
flag_MMYY = 0

if 1 <= A and A <= 12 and 1 <= B : 
    flag_MMYY += 1
if 1 <= B and B <= 12 and 1 <= A : 
    flag_YYMM += 1
    
if flag_YYMM == 0 and flag_MMYY == 0 : 
    print("YYMM")
elif flag_YYMM == 0 and flag_MMYY == 1 : 
    print("MMYY")
elif flag_YYMM == 1 and flag_MMYY == 0 : 
    print("YYMM")
elif flag_YYMM == 1 and flag_MMYY == 1 : 
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])

if(s1>=1 and s1<=12) and (s2>=1 and s2<=12):
  print("AMBIGUOUS")
elif((s1>=1 and s1<=12) and s2>12):
  print("MMYY")
elif(s1>12 and (s2<=12 and s2>=1)):
  print("YYMM")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
s1 = s[0:2]
s2 = s[2:4]

i1 = int(s1)
i2 = int(s2)
 
if i1 == 0 or i2 == 0:
    res ="NA"
else:
    if i1 <=12:
        if i2 <= 12:
            res = "AMBIGUOUS"
        else:
            res = "MMYY"
    else:
        if i2 <= 12:
            res = "YYMM"
        else:
            res = "NA"

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
s1 = s[0:2]
s2 = s[2:4]

i1 = int(s1)
i2 = int(s2)
 
if i1 == 0 or i2 == 0:
    res ="NA"
else:
    if i1 <=12:
        if i2 <= 12:
            res = "AMBIGUOUS"
        else:
            res = "MMYY"
    elif 12 < i1:
        if i2 <= 12:
            res = "YYMM"
        else:
            res = "NA"

print(res)

Submission status: Wrong Answer

Solution code:


S = input()

#YYMM か MMYY か AMBIGUOUS か NA か
#YYMM 1902
#MMYY 0599
#AMBIGUOUS 1212
#NA 9999

if S[0:2] < '13' and S[0:2] != '00' :
    if S[2:4] < '13' :
        print('AMBIGUOUS')
    else :
        print('MMYY')

else:
    if S[2:4] < '13' and S[2:4] != '00' :
        print('YYMM')
    else :
        print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = s[0:2]
s2 = s[2:4]

i1 = int(s1)
i2 = int(s2)
 
if i1 == 0 or i2 == 0: res ="NA"
if i1 <=12:
    if i2 <= 12:
        res = "AMBIGUOUS"
    else:
        res = "MMYY"
elif 12 < i1:
    if i2 <= 12:
        res = "YYMM"
    else:
        res = "NA"

print(res)

Submission status: Wrong Answer

Solution code:


S = input()

#YYMM か MMYY か AMBIGUOUS か NA か
#YYMM 1902
#MMYY 0599
#AMBIGUOUS 1212
#NA 9999

if S[0:2] < '13' :
    if S[2:4] < '13' :
        print('AMBIGUOUS')
    else :
        print('MMYY')

else:
    if S[2:4] < '13' :
        print('YYMM')
    else :
        print('NA')

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    left = int(s[0] + s[1])
    right = int(s[2] + s[3])

    if 1 <= left and left <= 12:
        if 1 <= right and right <= 12:
            return "AMIGUOUS"
        else:
            return "MMYY"
    else:
        if 1 <= right and right <= 12:
            return "YYMM"
        else:
            return "NA"

print(main())

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    left = int(s[0] + s[1])
    right = int(s[2] + s[3])

    if 1 <= left and left <= 12:
        if 1 <= right and right <= 12:
            return "AMIGUOUS"
        else:
            return "MMYY"
    else:
        if 1 <= right and right <= 12:
            return "MMYY"
        else:
            return "NA"

print(main())

Submission status: Wrong Answer

Solution code:
n = int(input())

a = n // 100
b = n % 100

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

Submission status: Wrong Answer

Solution code:
S = input()

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

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

Submission status: Wrong Answer

Solution code:
n = input()

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

Submission status: Wrong Answer

Solution code:
n = input()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def yymm():
    num = input()
    former = num[:2]
    latter = num[2:]

    former = int(former)
    latter = int(latter)
    print(former)
    print(latter)

    if 1 <= former <= 12 and 1<= latter <= 12:
        print('AMBIGUOUS')
    elif 1 <= former <= 12:
        print('MMYY')
    elif 1 <= latter <= 12:
        print('YYMM')
    else:
        print('NA')

if __name__ == '__main__':
    yymm()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

s = input()

former = int(s[:2])
latter = int(s[2:])

##YYMM
if ((former > 12) and (latter <= 12 and latter > 0)):
    print('YYMM')
    sys.exit()

##MMYY
if ((former <= 12 and former > 0) and (latter > 12)):
    print('MMYY')
    sys.exit()

##AMBIGUOUS
if ((former <= 12 and former > 0) and (latter <= 12 and latter > 0)):
    print('AMBIGUOUS')
    sys.exit()

##NA
print('NA')

Submission status: Wrong Answer

Solution code:
import sys

s = input()

former = int(s[:2])
latter = int(s[2:])

##YYMM
if ((former > 12) and (latter <= 12 and latter > 0)):
    print('YYMM')
    sys.exit()

##MMYY
if ((former <= 12 and former > 0) and (latter > 12)):
    print('MMYY')
    sys.exit()

##AMBIGUOUS
if ((former <= 12) and (latter <= 12)):
    print('AMBIGUOUS')
    sys.exit()

##NA
print('NA')

Submission status: Wrong Answer

Solution code:
import sys

s = input()

former = int(s[:2])
latter = int(s[2:])

##YYMM
if ((former > 12) and (latter <= 12 and latter > 0)):
    print('YYMM')
    sys.exit()

##MMYY
if ((former <= 12 and latter > 0) and (latter > 12)):
    print('MMYY')
    sys.exit()

##AMBIGUOUS
if ((former <= 12) and (latter <= 12)):
    print('AMBIGUOUS')
    sys.exit()

##NA
print('NA')