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

if 1 <= int(s[0:3]) <= 12 and 1 <= int(s[2:5]) <= 12:
    print('AMBIGUOUS')
elif 1 <= int(s[0:3]) <= 12:
    print('MMYY')
elif 1 <= int(s[2:5]) <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12):
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 or l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
n=input()
f=n[:2]
l=n[2:]
if f=="00" or l=="00" or (int(f)>12 and int(l)>12):
    print("NA")
elif int(f)>12:
    print("YYMM")
elif int(l)>12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
def main():
    s  = int(input())
    k = s//100
    t = s%100

    if(k>0 and k<13) and (t>0 and t<13):
        res = "AMBIGUOUS"
    elif(k>0 and k<13) and (t>13 or t==0):
        res = "MMYY"
    elif(t>0 and t<13) and (k>13 or k==0):
        res = "YYMM"
    else:
        res = "NA"
    print(res)






if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a = input()
b = a[0:2]
c = a[2:4]
if b.count("0") >= 1:
    print(b.strip("0"))
else:
    print(b)
if c.count("0") >= 1:
    print(c.strip("0"))
else:
    print(c)
b = int(b)
c = int(c)
if b > 12:
    if c > 12:
        print("NA")
    else:
        print("MMYY")
elif c > 12:
    if b < 13:
        print("YYMM")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:

s = input()
sa = int(s[:2])
sb = int(s[3:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
else:
    if sa >= 1 and sa <= 12:
        print('MMYY')
        exit()
    if sb >= 1 and sb <= 12:
        print('YYMM')
        exit()

print('NA')

Submission status: Wrong Answer

Solution code:

s = input()
sa = int(s[:2])
sb = int(s[3:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
if sa >= 1 and sa <= 12 and sb > 12:
    print('MMYY')
    exit()
if sa > 12 and sb >= 1 and sb <= 12:
    print('YYMM')
    exit()

print('NA')

Submission status: Wrong Answer

Solution code:

s = input()
sa = int(s[:2])
sb = int(s[3:])

if sa >= 1 and sa <= 12 and sb >= 1 and sb <= 12:
    print('AMBIGUOUS')
    exit()
if sa > 12 and sb > 12:
    print('NA')
    exit()
if sa >= 1 and sa <= 12 and sb > 12:
    print('MMYY')
    exit()
if sa > 12 and sb >= 1 and sb <= 12:
    print('YYMM')
    exit()

Submission status: Wrong Answer

Solution code:

s = input()
sa = int(s[:2])
sb = int(s[3:])

if sa <= 12 and sb <= 12:
    print('AMBIGUOUS')
    exit()
if sa > 12 and sb > 12:
    print('NA')
    exit()
if sa <= 12 and sb > 12:
    print('MMYY')
    exit()
if sa > 12 and sb <= 12:
    print('YYMM')
    exit()

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    P = int(S[0]+S[1])
    Q = int(S[2]+S[3])
    if 0<P<=12 and 0<Q<=12:
        print("AMBIGUOUS")
    elif 0<P<=12 and (Q>12 or Q==0):
        print("MMYY")
    elif (P>13 or P==0) and 0<Q<=12:
        print("YYMM")
    else:
        print("NA")
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    P = int(S[0]+S[1])
    Q = int(S[2]+S[3])
    if 0<P<=12 and 0<Q<=12:
        print("AMBIGUOUS")
    elif 0<P<=12 and (Q>12 or Q==0):
        print("MMYY")
    elif (P>13 or Q==0) and 0<Q<=12:
        print("YYMM")
    else:
        print("NA")
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    P = int(S[0]+S[1])
    Q = int(S[2]+S[3])
    if 00<P<=12 and 00<Q<=12:
        print("AMBIGUOUS")
    elif 00<P<=12 and Q>12:
        print("MMYY")
    elif P>13 and 00<Q<=12:
        print("YYMM")
    else:
        print("NA")
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[0])
s2 = int(s[1])
s3 = int(s[2])
s4 = int(s[3])
if(0 < (10 * s1 + s2) < 12 and 0 < (10 * s3 + s4) < 12):
  print('AMBIGUOUS')
elif(0 < (10 * s1 + s2) < 12):
  print('YYMM')
elif(0 < (10 * s3 + s4) < 12):
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[0])
s2 = int(s[1])
s3 = int(s[2])
s4 = int(s[3])
if(0 < (10 * s1 + s2) < 12 and 0 < (10 * s3 + s4) < 12):
  print('AMBIGUOUS')
elif(0 < (10 * s3 + s4) < 12):
  print('YYMM')
elif(0 < (10 * s1 + s2) < 12):
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    s12 = int(s[0]) * 10 + int(s[1]) * 1
    s34 = int(s[2]) * 10 + int(s[3]) * 1
    l = list()
    for i in [s12, s34]:
        if i >= 1 and i <= 12:
            l.append(True)
        else:
            l.append(False)
    if l[0] == False and l[1] == False:
        print('NA')
    elif l[0] == False and l[1] == True:
        print('YYMM')
    elif l[1] == True and l[0] == False:
        print('MMYY')
    else:
        print('AMBIGUOUS')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    s12 = int(s[0]) * 10 + int(s[1]) * 1
    s34 = int(s[2]) * 10 + int(s[3]) * 1
    l = list()
    for i in [s12, s34]:
        if i >= 1 and i <= 12:
            l.append(1)
        else:
            l.append(0)
    if sum(l) == 0:
        print('NA')
    elif sum(l) == 1:
        print('YYMM')
    else:
        print('AMBIGUOUS')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
if "00" in s:
    print("NA")
    exit(0)
ans = ""
s1 = int(s[:2])
s2 = int(s[-2:])
if s1 + s2 >= 26:
    ans = "NA"
elif s1 <= 12 and s2 <= 12:
    ans = "AMBIGUOUS"
elif s1 > 12:
    ans = "YYMM"
else:
    ans = "MMYY"
print(ans)

Submission status: Wrong Answer

Solution code:
def resolve():
    S = list(input())

    front = int(''.join(S[:2]))
    back = int(''.join(S[2:]))

    if (0 == front and 12 < back) or (0 == back and 12 < front):
        print('NA')
        return

    if (front <= 12 and back <= 12):
        print('AMBIGUOUS')
        return

    if (front > 12 and back <= 12):
        print('YYMM')
        return

    if (front <= 12 and back > 12):
        print('MMYY')
        return

    print('NA')

resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    S = list(input())

    front = int(''.join(S[:2]))
    back = int(''.join(S[2:]))

    if (0 == front or 0 == back):
        print('NA')
        return

    if (front <= 12 and back <= 12):
        print('AMBIGUOUS')
        return

    if (front > 12 and back <= 12):
        print('YYMM')
        return

    if (front <= 12 and back > 12):
        print('MMYY')
        return

    print('NA')

resolve()

Submission status: Wrong Answer

Solution code:
s = input()

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

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

Submission status: Wrong Answer

Solution code:
s = input()

#s = list(s)

mae = int(s[:2])
usi = int(s[2:])
#print(mae,usi)


if(mae >= 1 and mae <= 12 and usi >= 1 and usi <= 12):
  print("AMBIGUOUS")
elif(mae == 0 and usi == 0):
  print("NA")
elif(mae == 0 and usi >= 12):
  print("NA")
elif(mae >= 12 and usi == 0):
  print("NA")
elif(usi >= 1 and usi <= 12):
  print("YYMM")
elif(mae >= 1 and mae <= 12):
  print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()

#s = list(s)

mae = int(s[:2])
usi = int(s[2:])
#print(mae,usi)


if(mae >= 1 and mae <= 12 and usi >= 1 and usi <= 12):
  print("AMBIGUOUS")
elif(mae == 0 and usi == 0):
  print("NA")
elif(mae == 0 and usi >= 12):
  print("NA")
elif(mae >= 12 and usi == 0):
  print("NA")
elif(mae >= 0 and mae <= 99 and usi >= 1 and usi <= 12):
  print("YYMM")
elif(usi >= 0 and usi <= 99 and mae >= 1 and mae <= 12):
  print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()

#s = list(s)

mae = int(s[:2])
usi = int(s[2:])
#print(mae,usi)


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

Submission status: Wrong Answer

Solution code:
S = input()

highInt = int(S[0:2])
lowInt =int(S[2:4])

if highInt < 13 and lowInt < 13:
    ans = 'AMBIGUOUS'
elif highInt > 12 and lowInt > 12:
    ans = 'NA'
elif highInt < 13:
    ans = 'MMYY'
else:
    ans = 'YYMM'

print(ans)

Submission status: Wrong Answer

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

s = str(input())

a = s[0:2]

b = s[2:]


def div(a):
    a = int(a)
    if a <= 12 and a >= 1:
        return "BOTH"
    else:
        return "YY"


if div(a) == div(b):
    if div(a) == "YY":
        print("NA")
    else:
        print("AMBIGUOUS")
elif div(a) == "YY":
    print(b+a)
else:
    print(a+b)

Submission status: Wrong Answer

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

s = str(input())

s[0:2]

s[2:]


def div(a):
    a = int(a)
    if a <= 12 and a >= 1:
        return True
    else:
        return False


if div(s[0:2]) and div(s[2:]):
    print("AMBIGUOUS")
elif not div(s[0:2]) and not div(s[2:]):
    print("NA")
elif div(s[0:2]):
    print(s)
else:
    print(s[2:]+s[:2])

Submission status: Wrong Answer

Solution code:
import sys

S =int(input())
a = S//100
b = S%100
if 1 <= a <= 12 and 1 <= b <= 12 :
    print("AMBIGUOUS")
    sys.exit()

elif 1 <= a <= 12 :
    print("YYMM")
    sys.exit()

elif 1 <= b <= 12 :
    print("MMYY")
    sys.exit()
else : print("NA")

Submission status: Wrong Answer

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

ym = False
my = False
if a > 0 and b>0 and b <= 12:
  ym = True
if b > 0 and a>0 and a <= 12:
  my = True

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

Submission status: Wrong Answer

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

ym = False
my = False
if a > 0 and b>0 and b <= 12:
  ym = True
if b > 0 and a>0 and a <= 12:
  my = True

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

Submission status: Wrong Answer

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

ym = False
my = False
if a > 0 and b>0 and b <= 12:
  ym = True
if b > 0 and a>0 and a <= 12:
  my = True

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

Submission status: Wrong Answer

Solution code:
S = list(input())

M = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]

if S[0:2] in M and not(S[2:] in M):
    print("MMYY")
elif not(S[0:2] in M) and S[2:] in M:
    print("YYMM")
elif S[0:2] in M and S[2:] in M:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
from sys import stdin
def S(): return stdin.readline().rstrip()

s = S()

ym = True
my = True

tmp = ''
for i in range(2):
    tmp += s[i]
tmp = int(tmp)
if tmp<1:
    ym = False
    my = False
elif 12 < tmp:
    my = False

tmp = ''
for i in range(2):
    tmp += s[i+2]
tmp = int(tmp)
if tmp < 1:
    ym = False
    my = False
if 12 < tmp:
    ym = False

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
def S(): return stdin.readline().rstrip()

s = S()

y = True
m = True

tmp = ''
for i in range(2):
    tmp += s[i]
tmp = int(tmp)
if tmp<1 or 12<tmp:
    m = False

tmp = ''
for i in range(2):
    tmp += s[i+2]
tmp = int(tmp)
if tmp < 1:
    y = False
    m = False
if 12 < tmp:
    y = False

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

Submission status: Wrong Answer

Solution code:
S = input()
first = int(S[:2])
last = int(S[2:])
print(first, last)

is_month_first = False
is_month_last = False

if first <= 12 and first > 0:
    is_month_first = True
if last <= 12 and last > 0:
    is_month_last = True

if is_month_first and is_month_last:
    print("AMBIGUOUS")
elif not is_month_first and not is_month_last:
    print("NA")
else:
    if is_month_first:
        print("MMYY")
    else:
        print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = int(input())

aa = s // 100
bb = s % 100

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())
top = int(s[:2])
bottom = int(s[2:])

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

Submission status: Wrong Answer

Solution code:
# input
S = input()
x, y = S[:2], S[2:]

# check
not_YY_x = (int(x) >= 13)
not_YY_y = (int(y) >= 13)
zero_x = (x == "00")
zero_y = (y == "00")
checker = [not_YY_x, not_YY_y, zero_x, zero_y]

if checker == [True, False, False, False] or checker == [True, False, False, True]:
    print("YYMM")
elif checker == [False, True, False, False] or checker == [False, True, True, False]:
    print("MMYY")
elif checker == [False, False, False, False]:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# input
S = input()
x, y = S[:2], S[2:]

# check
not_YY_x = (int(x) >= 13)
not_YY_y = (int(y) >= 13)
zero_x = (x == "00")
zero_y = (y == "00")
checker = [not_YY_x, not_YY_y, zero_x, zero_y]

if checker == [True, False, False, False]:
    print("YYMM")
elif checker == [False, True, False, False]:
    print("MMYY")
elif checker == [False, False, False, False]:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# input
S = input()
x, y = S[:2], S[2:]

# check
not_YY_x = (int(x) >= 13)
not_YY_y = (int(y) >= 13)
zero_x = (x == "00")
zero_y = (y == "00")
checker = [not_YY_x, not_YY_y, zero_x, zero_y]

if checker == [True, False, False, False]:
    print("MMYY")
elif checker == [False, True, False, False]:
    print("YYMM")
elif checker == [False, False, False, False]:
    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 a > 12 and b >12:
  print('NA')
if (a == 0 and b >12) or (b ==0 and a > 12) or (a==0 and b ==0):
  print('NA')
elif a <= 12 and b <= 12:
  print('AMBIGUOUS')
elif a <= 12 and b > 12:
  print('MMYY')
elif a > 12 and b <= 12:
  print('YYMM')

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:
  print('NA')
if (a == 0 and b >12) or (b ==0 and a > 12):
  print('NA')
elif a <= 12 and b <= 12:
  print('AMBIGUOUS')
elif a <= 12 and b > 12:
  print('MMYY')
elif a > 12 and b <= 12:
  print('YYMM')

Submission status: Wrong Answer

Solution code:
S = list(input())
f1 = 1
f2 = 1
A = int(''.join(S[:2]))
B = int(''.join(S[2:]))
print(A,B)
if A >= 13 or A == 0:
    f1 = 0
if B >= 13 or B == 0:
    f2 = 0
if f1 == 1 and f2 == 1:
    print('AMBIGUOUS')
elif f1 == 1 and f2 == 0:
    print('MMYY')
elif f1 == 0 and f2 == 1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = list(input())
f1 = 1
f2 = 1
A = int(''.join(S[:2]))
B = int(''.join(S[2:]))
if A >= 13 or A == 0:
    f1 = 0
if B >= 13 or A == 0:
    f2 = 0
if f1 == 1 and f2 == 1:
    print('AMBIGUOUS')
elif f1 == 1 and f2 == 0:
    print('MMYY')
elif f1 == 0 and f2 == 1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = list(input())
f1 = 1
f2 = 1
A = int(''.join(S[:2]))
B = int(''.join(S[2:]))
if A >= 13:
    f1 = 0
if B >= 13:
    f2 = 0
if f1 == 1 and f2 == 1:
    print('AMBIGUOUS')
elif f1 == 1 and f2 == 0:
    print('MMYY')
elif f1 == 0 and f2 == 1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
S = list(input())[:-1]
a = 10*int(S[0])+int(S[1])
b = 10*int(S[2])+int(S[3])
if a > 12 and b > 12:
    print("NA")
elif a > 12:
    print("YYMM")
elif b > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
ym = int(input())
 
ym1 = int(ym/100)
ym2 = int(ym%100)

print(ym1,ym2)
 
if ym1 >= 1 and ym1 <= 12 and ym2 >= 1 and ym2 <=12:
  print('AMBIGUOUS')
elif ym2>=1 and ym2<=12:
  print('YYMM')
elif ym1>=1 and ym1<=12:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ym = int(input())

ym1 = ym/100
ym2 = ym%100

if ym1>=1 and ym1<=12 and ym2>=1 and ym2<=12:
  print('AMBIGUOUS')
elif ym1<1 or ym1 >12 and ym2<1 or ym2>12:
  print('NA')
elif ym2<1 or ym2>12:
  print('MMYY')
else:
  print('YYMM')

Submission status: Wrong Answer

Solution code:
S=input()
a=int(S[:2]); b=int(S[2:])
if 0<a and 0<b:
    if a<13 and b<13:
        print('AMBIGUOUS')
    elif a<13:
        print('MMYY')
    elif b<13:
        print('YYMM')
    else:
        print('NA')
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) and (0<b and b<13): print('AMGIGUOUS')
elif (0<a and a<13) and 0<b: print('MMYY')
elif 0<a and (0<b and b<13): print('YYMM')
else: print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())

for i in range(4):
    s[i] = int(s[i])

a = s[0]*10 + s[1]
b = s[2]*10 + s[3]


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

Submission status: Wrong Answer

Solution code:
s = list(input())

for i in range(4):
    s[i] = int(s[i])

a = s[0]*10 + s[1]
b = s[2]*10 + s[3]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c,d=input()
x=int(a+b)
y=int(c+d)
if 1<=x<=12 and 1<=y<=12:
  print('AMBIGUOUS')
elif 1<=x<=12 and 0<=y<=99:
  print('MMYY')
elif 0<=x<=99 and 1<=y<12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
a,b,c,d=input()
x=int(a+b)
y=int(c+d)
if 1<=x<=12 and 1<=y<=12:
  print('AMBIGUOUS')
elif 1<=x<=12 and 0<=y<=99:
  print('MMYY')
elif 0<=x<=99 and 1<=x<12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
a,b,c,d=input()
x=int(a+b)
y=int(c+d)
if 1<=x<=12 and 1<=y<=12:
  print('AMBIGUOUS')
elif 1<=x<=12 and 13<=y<=99:
  print('MMYY')
elif 13<=x<=99 and 1<=x<12:
  print('YYMM')
elif 1<=x<=12 and y==0:
  print('MMYY')
elif x==0 and 1<=y<=12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

A = S[:2]
B = S[2:]

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

Submission status: Wrong Answer

Solution code:
X = input()
A = int(X[0:2])
B = int(X[2:])
 
if A == 0:
  if B == 0:
    print('NA')
  elif B > 12:
    print('NA')
  else:
    print('YYMM')
elif A > 12:
  if B == 0:
    print('NA')
  elif B > 12:
    print('NA')
  else:
    print('YYMM')
else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
import math
import itertools
import heapq
import sys
sys.setrecursionlimit(10**6)

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
input_list = lambda : list(map(int,input().split()))

s=input()
p_a=int(s[:2])
p_b=int(s[2:])
yymm=(0<p_b<12)
mmyy=(0<p_a<12)

if yymm and mmyy:
    print("AMBIGUOUS")
    exit()

if yymm:
    print("YYMM")
    exit()
if mmyy:
    print("MMYY")
    exit()

print("NA")

Submission status: Wrong Answer

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
import math
import itertools
import heapq
import sys
sys.setrecursionlimit(10**6)

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
input_list = lambda : list(map(int,input().split()))

s=input()
p_a=int(s[:2])
p_b=int(s[2:])
if (p_a==0 and p_b==0) or (p_a==0 and p_b>12) or (p_b==0 and p_a>12):
    print("NA")
    exit()
if min(p_a,p_b)>12:
    print("NA")
    exit()

if max(p_a,p_b)<13 and min(p_a,p_b)>0:
    print("AMBIGUOUS")
    exit()

if p_a>12:
    print("YYMM")
    exit()

print("MMYY")

Submission status: Wrong Answer

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
import math
import itertools
import heapq
import sys
sys.setrecursionlimit(10**6)

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
input_list = lambda : list(map(int,input().split()))

s=input()
p_a=int(s[:2])
p_b=int(s[2:])
if p_a==0 or p_b==0:
    print("NA")
    exit()
if min(p_a,p_b)>12:
    print("NA")
    exit()

if max(p_a,p_b)<13:
    print("AMBIGUOUS")
    exit()

if p_a>12:
    print("YYMM")
    exit()

print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()

front = s[0]+s[1]
back = s[2]+s[3]
c = [1,2,3,4,5,6,7,8,9,10,11,12]

if front=="00" or back == "00":
    print("NA")
elif c.count(int(front))==1 and c.count(int(back)) == 1:
    print("AMBIGUOUS")
elif c.count(int(back))==1:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
YY=[]
MM=["01","02","03","04","05","06","07","08","09","10","11","12"]

for i in range(13,100):
    YY.append(str(i))

if s[:2] in YY and s[2:] in MM:
    print("YYMM")
elif s[:2] in MM and s[2:] in YY:
    print("MMYY")

elif s[:2] in MM and s[2:] in MM:
    print("AMBIGUOUS")
elif s[:2] in YY and s[2:] in YY:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
YY=[]
MM=["01","02","03","04","05","06","07","08","09","10","11","12"]

for i in range(13,100):
    YY.append(str(i))

#YYMM
if s[:2] in YY and s[2:] in MM:
    print("YYMM")
#MMYY
elif s[:2] in MM and s[2:] in YY:
    print("MMYY")

elif s[:2] in MM and s[2:] in MM:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
L = int(S[:2])
R = int(S[2:])
if (1<=L<=12):
    if (1<=R<=12):
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if (1<=R<=12):
        print("YYMM")
    else:
        print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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