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:
n = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen and zen <= 12 and go and go <= 12:
  print("AMBIGUOUS")
elif zen and zen <= 12 and go and go > 12:
  print("MMYY")
elif zen and zen > 12 and go and go <= 12:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
word=list(s)
flaga=0
flagb=0
if (s[0]=='0' and 1<=int(s[1])<=9) or (s[0]=='1' and 0<=int(s[1])<=2):
  flaga+=1
if (s[2]=='0' and 1<=int(s[3])<=9) or (s[2]=='1' and 0<=int(s[3])<=2):
  flagb+=1

if flaga==1 and flagb==1:
  print('AMBIGUOUS')
elif flaga==1 and flagb==0:
  print('YYMM')
elif flaga==0 and flagb==1:
  print('MMYY')
elif flaga==0 and flagb==0:
  print('NA')

Submission status: Wrong Answer

Solution code:
n = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen and zen <= 12 and go and go <= 12:
  print("AMBIGUOUS")
elif zen and zen <= 12 and go and go > 12:
  print("MMYY")
elif zen > 12 and go <= 12:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
n = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen <= 12 and go <= 12:
  print("AMBIGUOUS")
elif zen <= 12 and go > 12:
  print("MMYY")
elif zen > 12 and go <= 12:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
n = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen <= 12 and go <= 12:
  print("AMBIGUOUS")
elif zen > 12 and go > 12:
  print("NA")
elif zen == 0 or go == 0:
  print("NA")
elif zen <= 12 and go > 12:
  print("MMYY")
elif zen > 12 and go <= 12:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
n = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen <= 12 and go <= 12:
  print("AMBIGUOUS")
elif zen > 12 and go > 12:
  print("NA")
elif zen <= 12 and go > 12:
  print("MMYY")
elif zen > 12 and go <= 12:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
n = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen <= 12 and go <= 12:
  print("AMBIGUOUS")
elif zen > 12 and go > 12:
  print("NA")
elif zen <= 12 and go > 12:
  print("YYMM")
elif zen > 12 and go <= 12:
  print("MMYY")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
N = list(N)

ab = N[0] + N[1]
cd = N[2] + N[3]


if N[0] == 0:
  ab = ab.zfill(2)

if N[2] == 0:
  cd = cd.zfill(2)

if ab == "00" or cd == "00":
  print("NA")  

elif int(ab) > 12 and int(cd) > 12:
  print("NA")  

elif 13 > int(ab) > 0 and 13 > int(cd) > 0:
  print("AMBIGUOUS")

elif int(ab) > 12 and int(cd) < 13:
  print("YYMM")

elif 13 > int(ab) > 0 and int(cd) > 12:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
N = input()
N = list(N)
# N = int(N)
print(N)

ab = N[0] + N[1]
cd = N[2] + N[3]

# ab = int(ab)
# cd = int(cd)

if N[0] == 0:
  ab = ab.zfill(2)

if N[2] == 0:
  cd = cd.zfill(2)

# print(ab)
# print(cd)


if ab == "00" or cd == "00":
  print("NA")  

elif int(ab) > 12 and int(cd) > 12:
  print("NA")  

elif 13 > int(ab) > 0 and 13 > int(cd) > 0:
  print("AMBIGUOUS")

elif int(ab) > 12 and int(cd) < 13:
  print("YYMM")

elif 13 > int(ab) > 0 and int(cd) > 12:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
N = input()
N = list(N)

ab = N[0] + N[1]
cd = N[2] + N[3]

if N[0] == 0:
  ab = ab.zfill(2)

if N[2] == 0:
  cd = cd.zfill(2)

if ab == "00" or cd == "00":
  print("NA")  

elif 13 > int(ab) > 0 and 13 > int(cd) > 0:
  print("AMBIGUOUS")

elif int(ab) > 12 and int(cd) < 13:
  print("YYMM")

elif 13 > int(ab) > 0 and int(cd) > 12:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
N = input()
N = list(N)
# N = int(N)

ab = N[0] + N[1]
cd = N[2] + N[3]

# ab = int(ab)
# cd = int(cd)

if N[0] == 0:
  ab = ab.zfill(2)

if N[2] == 0:
  cd = cd.zfill(2)

# print(ab)
# print(cd)


if int(ab) == 0 or int(cd) == 0:
  print("NA")  

elif int(ab) > 12 and int(cd) <= 12:
  print("YYMM")

elif 13 > int(ab) > 0 and 13 > int(cd) > 0:
  print("AMBIGUOUS")

elif 13 > int(ab) > 0 and int(cd) > 12:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
a=input()
x=int(a[0]+a[1])
y=int(a[2]+a[3])
if x>12:
    print("YYMM")
elif y>12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
ym = 0
my = 0

s = input()

hi = int(s[2:])
lo = int(s[:2])

def isym(l,h):
    if h == 0:
        return False
    if l == 0:
        return False
    if l <= 12:
        return True
    else:
        return False

ym = 0
my = 0
if isym(hi,lo):
    ym = 1
if isym(lo,hi):
    my = 1

if ym == 1 and my == 1:
    print('AMBIGUOUS')
if ym == 1 and my == 0:
    print('YYMM')
if ym == 0 and my == 1:
    print('MMYY')
if ym == 0 and my == 0:
    print('NA')

Submission status: Wrong Answer

Solution code:
ym = 0
my = 0

s = input()


if int(s[2:]) <= 12:
    ym = 1

if int(s[:2]) <= 12:
    my = 1

if int(s[:2]) == 0 or int(s[2:]) == 0:
    ym = 0
    my = 0
    print('NA')

if ym == 1 and my == 1:
    print('AMBIGUOUS')

if ym == 1 and my == 0:
    print('YYMM')

if ym == 0 and my == 1:
    print('MMYY')

if int(s[2:]) > 12 and int(s[:2]) > 12:
    print('NA')

Submission status: Wrong Answer

Solution code:
ym = 0
my = 0

s = input()


if int(s[2:]) <= 12:
    ym = 1

if int(s[:2]) <= 12:
    my = 1

if int(s[:2]) == 0 or int(s[2:]) == 0:
    ym = 0
    my = 0
    print('NA')

if ym == 1 and my == 1:
    print('AMBIGUOUS')

if ym == 1 and my == 0:
    print('YYMM')

if ym == 0 and my == 1:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
s = input()
my, ym = 0< int(s[:2]) <13, 0< int(s[2:]) <13

my,ym = 0<int(s[:2])<13,0<int(s[2:])<13

if my and ym:
    print('AMBIGUOUS')
    
elif my:
    print('YYMM')
    
elif ym:
    print("MMYY")
    
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
def isMM(date):

    n_date= int(date)

    if 1 <= n_date <= 12:
        return True
    else:
        return False

def isYY(date):

    n_date = int(date)

    if 0 <= n_date <= 99:
        return True
    else:
        return False

def isYYMM(date):

    if isYY(date[0:2]) and isMM(date[3:5]):
        return True
    else:
        return False

def isMMYY(date):

    if isMM(date[0:2]) and isYY(date[3:5]):
        return True
    else:
        return False

def main(): 

    S = input()

    if isYYMM(S) and isMMYY(S):
        print('AMBIGUOUS')
    elif isYYMM(S):
        print('YYMM')
    elif isMMYY(S):
        print('MMYY')
    else:
        print('NA')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def isMM(date):

    n_date= int(date)

    if 1 <= n_date <= 12:
        return True
    else:
        return False

def isYY(date):

    n_date = int(date)

    if 0 <= n_date <= 99:
        return True
    else:
        return False

def isYYMM(date):

    if isYY(date[1:3]) and isMM(date[3:5]):
        return True
    else:
        return False

def isMMYY(date):

    if isMM(date[1:3]) and isYY(date[3:5]):
        return True
    else:
        return False

def main(): 

    S = input()

    if isYYMM(S) and isMMYY(S):
        print('AMBIGUOUS')
    elif isYYMM(S):
        print('YYMM')
    elif isMMYY(S):
        print('MMYY')
    else:
        print('NA')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=input();l,r=int(n[:2])<1or int(n[:2])>13,int(n[2:])<1or int(n[2:])>13 
if l and r:p="NA"
elif not(l or r):p="AMBIGUOUS"
elif l and not r:p="YYMM"
else:p="MMYY"
print(p)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if 0<a and a<13:
  if 0<b and b<13:
    print('AMBIGUOUS')
  elif b<0 or b>13:
    print('MMYY')
elif a<0 or a>13:
  if 0<b and b<13:
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(map(str, input()))
first=int("".join(s[:2]))
last=int("".join(s[2:]))

if 1 <= first <= 12:
    if 1 <= last <= 12:
        print("AMBIGUOUS")
    elif last > 12:
        print("MMYY")
elif 1 <= last <= 12:
    if 1 <= first <= 12:
        print("AMBIGUOUS")
    elif first > 12:
        print("YYMM")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
import sys
s = input()
a = int(s[:2])
b = int(s[2:])
if a == 0 and b == 0:
  print('NA')
  sys.exit(0)
if a > 12 and b > 12:
  print('NA')
  sys.exit(0)
if a == 0:
  print('YYMM')
  sys.exit(0)
if b == 0:
  print('MMYY')
  sys.exit(0)
elif b > 12:
  print('MMYY')
  sys.exit(0)
elif a > 12:
  print('YYMM')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
import sys
s = input()
a = int(s[:2])
b = int(s[2:])
if a == 0:
  print('NA')
  sys.exit(0)
if b == 0:
  print('NA')
  sys.exit(0)
if a > 12 and b > 12:
  print('NA')
  sys.exit(0)
elif b > 12:
  print('MMYY')
  sys.exit(0)
elif a > 12:
  print('YYMM')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s0 = list(input())
s = []
for i in s0:
    s.append(i)
A = s[:2]
B = s[2:]
a = "".join(A)
b = "".join(B)
a = int(a)
b = int(b)
if 0<a<=12 and 0<b<=12:
  print("AMBIGUOUS")
elif a>12 and 0<b<=12:
  print("YYMM")
elif 0<a<=12 and b>12:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
x = 0

sf = s[:2]
sl = s[2:]

if (int(sf[0]) == 0 and int(sf[1]) != 0):
    x += 1
if (int(sl[0]) == 0 and int(sl[1]) != 0):
    x += 2
    
b = x
if b == 0:
  print('NA')
elif b == 3:
  print('AMBIGUOUS')
elif b == 1:
  print('MMYY')
elif b == 2:
  print('YYMM')

Submission status: Wrong Answer

Solution code:
s = input()
x = 0

sf = s[:2]
sl = s[2:]

if (int(sf[0]) == 0 and int(sf[1]) != 0):
    x += 1
if (int(sl[0]) == 0 and int(sl[1]) != 0):
    x += 2
"""
for j in range(0,2):
  if sl[0] == 1:
      if sl[1] == j:
        a += 2
"""
b = x

if b == 0:
  print('NA')
elif b == 3:
  print('AMBIGUOUS')
elif b == 1:
  print('MMYY')
elif b == 2:
  print('YYMM')

print(sf[0],sf[1],sl[0],sl[1])

Submission status: Wrong Answer

Solution code:
s = input()
a = 0

sf = s[:1]  #'sf' is the formar part of the S
sl = s[2:]  #'sl' is the latter part of the S

for i in range(1,9):
  if sf[0] == 0:
    if sf[1] == i:
      a += 1

for j in range(0,2):
  if sf[0] == 1:
      if sf[1] == j:
        a += 1
        
for i in range(1,9):
  if sl[0] == 0:
    if sl[1] == i:
      a += 2

for j in range(0,2):
  if sl[0] == 1:
      if sl[1] == j:
        a += 2
    
if a == 0:
  print('NA')
elif a == 3:
  print('AMBIGUOUS')
elif a == 1:
  print('MMYY')
elif a == 2:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
s = input()
a = 0

sf = s[:1]  #'sf' is the formar part of the S
sl = s[2:]  #'sl' is the latter part of the S

for i in range(1,9):
  if sf[0] == 0:
    if sf[1] == i:
      a += 1

for j in range(0,2):
  if sf[0] == 1:
      if sf[1] == j:
        a += 1
        
for i in range(1,9):
  if sl[0] == 0:
    if sl[1] == i:
      a += 2

for j in range(0,2):
  if sl[0] == 1:
      if sl[1] == j:
        a += 2
    
if a == 0:
  print('NA')
elif a == 3:
  print('AMBIGUOUS')
elif a == 1:
  print('YYMM')
elif a == 2:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
s = input()
a = 0

sf = s[:1]  #'sf' is the formar part of the S
sl = s[2:]  #'sl' is the latter part of the S

for i in range(1,9):
  if sf[0] == 0:
    if sf[1] == i:
      a += 1

for j in range(0,2):
  if sf[0] == 1:
      if sf[1] == j:
        a += 1
        
for i in range(1,9):
  if sl[0] == 0:
    if sl[1] == i:
      a += 2

for j in range(0,2):
  if sl[0] == 1:
      if sl[1] == j:
        a += 2
    
if a == 0:
  print('NA')
elif a == 3:
  print('AMBIGUOUS')
elif a == 2:
  print('YYMM')
elif a == 1:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
s = input()
a = 0

sf = s[:1]  #'sf' is the formar part of the S
sl = s[2:]  #'sl' is the latter part of the S

for i in range(1,9):
  if sf[0] == 0:
    if sf[1] == i:
      a += 1

for j in range(0,2):
  if sf[0] == 1:
      if sf[1] == j:
        a += 1
        
for i in range(1,9):
  if sl[0] == 0:
    if sl[1] == i:
      a += 1

for j in range(0,2):
  if sl[0] == 1:
      if sl[1] == j:
        a += 1
    
if a == 0:
  print('NA')
elif a == 2:
  print('AMBIGUOUS')
elif a == 2:
  print('YYMM')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])
if s1 <= 0 or s2 <= 0:
    print('NA')
    exit()
elif s1 < 13 and s2 < 13:
    print('AMBIGUOUS')
elif s1 < 13:
    print('MMYY')
elif s2 < 13:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[:2])
s2 = int(s[2:])
if s1 == 0 or s2 == 0:
    print('NA')
    exit()
elif s1 < 13 and s2 < 13:
    print('AMBIGUOUS')
elif s1 < 13:
    print('MMYY')
elif s2 < 13:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
import sys
from heapq import heappush, heappop


def main():
    input = sys.stdin.readline
    S = input()
    a = int(S[:2])
    b = int(S[2:])
    if (a > 12 or a == 0) and 1 <= b <= 12:
        print('YYMM')
    elif 1 <= a <= 12 and (b > 12 or a == 0):
        print('MMYY')
    elif 1 <= a <= 12 and 1 <= b <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
import sys
from heapq import heappush, heappop

def main():
    input = sys.stdin.readline
    S = input()
    a = int(S[:2])
    b = int(S[2:])
    if a > 12 and 1 <= b <= 12:
        print('YYMM')
    elif 1 <= a <= 12 and b > 12:
        print('MMYY')
    elif 1 <= a <=12 and 1 <= b <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
import sys
from heapq import heappush, heappop

def main():
    input = sys.stdin.readline
    S = input()
    a = int(S[:2])
    b = int(S[2:])
    if a > 12 and b == 0 or a == 0 and b > 12:
        print('NA')
    elif a > 12 and b <= 12:
        print('YYMM')
    elif a <= 12 and b > 12:
        print('MMYY')
    elif a <=12 and b <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
import sys
from heapq import heappush, heappop

def main():
    input = sys.stdin.readline
    S = input()
    a = int(S[:2])
    b = int(S[2:])
    if a > 12 and b == 0 or a == 0 and b > 12:
        print('NA')
    if a > 12 and b <= 12:
        print('YYMM')
    elif a <= 12 and b > 12:
        print('MMYY')
    elif a <=12 and b <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
import sys
from heapq import heappush, heappop

def main():
    input = sys.stdin.readline
    S = input()
    a = int(S[:2])
    b = int(S[2:])
    if a > 12 and b <= 12:
        print('YYMM')
    elif a <= 12 and b > 12:
        print('MMYY')
    elif a <=12 and b <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = list(str(input()))

aa = 10*int(s[0]) + int(s[1])
bb = 10*int(s[2]) + int(s[3])
if 1 <= aa <= 12 and 1 <= bb <= 12:
    print("AMBIGUOUS") 
elif 1 <= aa <= 99 and 1 <= bb <= 12:
    print("YYMM")
elif 1 <= aa <= 12 and 1 <= bb <= 99:
    print("MMYY")
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])
if 1 <= a <= 12 and 1 <= b <= 12:
  print('ANBIGUOUS')
elif (a < 1 or a > 12) and 1 <= b <= 12:
  print('YYMM')
elif 1 <= a <= 12 and (b < 1 or b > 12):
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
#ABC127B
S = input()
ab,cd = S[0:2],S[2:4]
if ab == "00" and cd == "00":
    print("NA")
elif int(ab) >= 13 and int(cd) >= 13:
    print("NA")
elif ab == "00" and int(cd) <= 12:
    print("YYMM")
elif int(ab) <= 12 and cd == "00":
    print("MMYY")
elif int(ab) <= 12 and int(cd) <= 12:
    print("AMBIGUOUS")
elif int(ab) <= 12 and int(cd) >= 13:
    print("MMYY")
elif int(ab) >= 13 and int(cd) <= 12:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
#ABC127B
S = input()
ab,cd = S[0:2],S[2:4]
if ab == "00" or cd == "00":
    print("NA")
elif int(ab) >= 13 and int(cd) >= 13:
    print("NA")
elif int(ab) <= 12 and int(cd) <= 12:
    print("AMBIGUOUS")
elif int(ab) <= 12 and int(cd) >= 13:
    print("MMYY")
elif int(ab) >= 13 and int(cd) <= 12:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
#ABC127B
S = input()
ab,cd = S[0:2],S[2:4]
if ab == "00" or cd == "00":
    print("NA")
elif int(ab) <= 12 and int(cd) <= 12:
    print("AMBIGUOUS")
elif int(ab) <= 12 and int(cd) >= 13:
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
pre = int(s[:2])
post = int(s[2:])

if 1 <= pre <= 12 and 1 <= post <= 12:
    print('AMBIGUOUS ')
elif 13 <= pre <= 99 and 1 <= post <= 12:
    print('YYMM')
elif 1 <= pre <= 12 and 0 < post <= 99:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
ymflag = True
myflag = True
head = int(s[:2])
tail = int(s[2:])
if head > 12:
    myflag = False
elif head == 0:
    myflag = False
    ymflag = False

if tail > 12:
    ymflag = False
elif tail == 0:
    myflag = False
    ymflag = False
if ymflag and myflag:
    print("AMBIGUOUS")
elif ymflag:
    print("YYMM")
elif myflag:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[:2])
b=int(s[2:])
def f(a):
    a1,a2=0,0
    if 1<=a<=12:
        a1=1
    if 0<=a<=99:
        a2=1
    return (a1,a2)
a1,a2=f(a)
b1,b2=f(b)
if a1 and a2 and b1 and b2:
    print('AMBIGUAUS')
elif a1 and b2:
    print('MMYY')
elif a2 and b1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
X = input()

X1 = 10*int(X[0]) + int(X[1])
X2 = 10*int(X[2]) + int(X[3])

if (1 <= X1 <= 12) and ((X2 > 12) or (X2 == 0)):
    print("MMYY")
elif ((X2 > 12) or (X2 == 0)) and (1 <= X1 <= 12):
    print("YYMM")
elif (1 <= X1 <= 12) and (1 <= X2 <= 12):
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
X = input()

X1 = 10*int(X[0]) + int(X[1])
X2 = 10*int(X[2]) + int(X[3])

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

Submission status: Wrong Answer

Solution code:
X = input()

if X[0] == '0' and X[2] != '0':
    print("MMYY")
elif X[0] != '0' and X[2] == '0':
    print("YYMM")
elif X[0] != '0' and X[2] != '0':
    print("NA")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S=input()

if int(S[:2])<=12:
  if 0<int(S[2:])<=12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if 0<int(S[2:])<=12:
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S=input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(i for i in input())
x,y = int(s[0] + s[1]),int(s[2] + s[3])
if x < 13 and x > 0 and y < 13 and y > 0:
  print('AMBIGUOUS')
elif x >= 13 and y < 13 and y > 0:
  print('YYMM')
elif x < 13 and x > 0 and y >= 13:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = list(i for i in input())
x,y = int(s[0] + s[1]),int(s[2] + s[3])
if x < 13 and x > 0 and y < 13 and y > 0:
  print('AMBIGUOUS')
elif x >= 13 and y < 13:
  print('YYMM')
elif x < 13 and y >= 13:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = list(i for i in input())
x,y = int(s[0] + s[1]),int(s[2] + s[3])
if x == 0 and y == 0:
  print('NA')
elif x >= 13 and y < 13:
  print('YYMM')
elif x < 13 and y >= 13:
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
S_list = list(S)
A = int(S_list[0]) * 10 + int(S_list[1])
B = int(S_list[2]) * 10 + int(S_list[3])

if A <= 12 and 1 <= A:
    if B <= 12 and 1 <= B:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if B <= 12 and 1 <= B:
        print("YYMM")
    else:
        print("MA")

Submission status: Wrong Answer

Solution code:
S = input()

head = S[:2]
tail = S[2:]


if 12>=int(head)>=1 and 12>=int(tail)>=1:
    print("AMBIGUOUS")
elif 12>=int(head)>=1:
    print("YYMM")
elif 12>=int(tail)>=1:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
#YYMM, MMYY, AMBIGUOUS, NA 
if int(s[:2])<1 or int(s[2:])<1:
  print("NA")

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

Submission status: Wrong Answer

Solution code:
s=int(input())
s1=s//100
s2=s%100

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if s1==0 or s2==0:
  print("NA")
elif 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()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S =input()
#MMYYcheck
ans = "NA"
if 0 < int(S[0])*10+int(S[1]) < 13 :
    ans = "MMYY"
if 0<int(S[2])*10+int(S[3])<13:
    if ans == "MMYY":
         ans ="ANBIGUOUS"
    else: ans ="YYMM"
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

left = int(s[0]) * 10 + int(s[1])
right = int(s[2]) * 10 + int(s[3])

if 1 <= left <= 12 and 1 <= right <= 12:
    print("AMBIGUOUS")
elif 1 <= left <= 12 and 1 <= right:
    print("MMYY")
elif 1 <= left and 1 <= right <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
a, b, c, d = list(input())
a = int(a)
b = int(b)
c = int(c)
d = int(d)
if 0 < 10*a + b <= 12 and 0 < c*10 + d <= 12:
    print('AMBIGUOUS')
elif 10*a + b >= 12 and 0 < c*10 + d <= 12:
    print('YYMM')
elif 0 < 10*a + b <= 12 and c*10 + d >= 12:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
former=int(s[:2])
latter=int(s[2:])

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

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[0:2])
b = int(S[2:4])
print(a, b)
fym = False
fmy = False
if 1<=a<=12:
  fmy = True
if 1<=b<=12:
  fym = True
if fmy and fym:
  print("AMBIGUOUS")
elif fmy:
  print("MMYY")
elif fym:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[0:2])
b = int(S[2:4])
fym = False
fmy = False
if 1<=a<=12:
  fmy == True
if 1<=b<=12:
  fym == True
if fmy and fym:
  print("AMBIGUOUS")
elif fmy:
  print("MMYY")
elif fym:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
AA = int(S[0])*10+int(S[1])
BB = int(S[2])*10+int(S[3])

ans = ""

if AA < 13 and AA != 0 and BB < 13 and BB != 0:
    ans = "AMBIGUOUS"
elif AA >= 13 and BB <13 and BB != 0:
    ans = "YYMM"
elif AA < 13 and AA != 0 and BB >= 13:
    ans = "MMYY"
else:
    ans = "NA"

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()

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