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: Runtime Error

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

if 1 <= a <= 12:
  f_yymm = True
if 1 <= b <= 12:
  f_mmyy = True:
    
if f_yymm and f_mmyy:
  print("AMBIGUOUS")
elif f_yymm and (not f_mmyy):
  print("YYMM")
elif (not f_yymm) and f_mmyy:
  print("MMYY")
else:
  print("NA")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = input()
if (a[:2] >0 and a[:2]<13) and (a[2:] >0 and a[2:]<13):
  print("both")
if (a[:2] >0 and a[:2]<13) and (a[2:] ==0 or a[2:]>13):
  print("MMYY")
if (a[:2] ==0 or  a[:2]>13) and (a[2:]>0 or a[2:]<13):
  print("YYMM")
if (a[:2] ==0 or  a[:2]>13) and (a[2:] ==0 or a[2:]>13):
  print("YYMM")

Submission status: Runtime Error

Solution code:
import sys
rr = lambda: sys.stdin.readline().strip()
ri = lambda: int(rr())
rs = lambda: [int(_) for _ in rr().split()]

S = rr()

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

Submission status: Runtime Error

Solution code:
import sys
rr = lambda: sys.stdin.readline().strip()
ri = lambda: int(rr())
rs = lambda: [int(_) for _ in rr().split()]

S = rr()

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

Submission status: Runtime Error

Solution code:
S = input()

fr_half = int(S[0:2]) 
se_half = int(S[2::])

if se_half > 0 and se_half <= 12:
	if fr_half  > 0 and fr_half <= 12:
		print('AMBIGUOUS')
  	else:
		print('YYMM')
else:
	if fr_half  > 0 and fr_half <= 12:
		print('MMYY')
	else:
		print('NA')

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

Solution code:
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: Runtime Error

Solution code:
s = str(input())
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Submission status: Runtime Error

Solution code:
s = input()
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Submission status: Runtime Error

Solution code:
s = list(str(1234))
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Submission status: Runtime Error

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

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: Runtime Error

Solution code:
S = input()
s_1 = S[:2]
s_2 = S[2:]

if 0 < s_1 < 13 and 0 < s_2 < 13:
  print("AMBIGUOUS")
elif 0 < s_1 < 13:
  print("MMYY")
elif 0 < s_2 < 13:
  print("YYMM")
else:
  print("NA")

Submission status: Runtime Error

Solution code:
s=input()
if (int(s[0]+s[1])>12 or  or int(s[0]+s[1])==00) 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: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl
#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl
using namespace std;
int MOD = 1000000007;

signed main(){
    string s;
    cin >> s;
    int a = (s[0]-'0')*10 + (s[1]-'0');
    int b = (s[2]-'0')*10 + (s[3]-'0');
    cerr << a << " " << b << endl;
    if(1 <= a && a <= 12 && 1 <= b && b <= 12){
        cout << "AMBIGUOUS" << endl;
    }else if(1 <= a && a <= 12){
        cout << "MMYY" << endl;
    }else if(1 <= b && b <= 12){
        cout << "YYMM" << endl;
    }else{
        cout << "NA" << endl;
    }

    return 0; 
}

// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl https://cf17-final-open.contest.atcoder.jp/tasks/cf17_final_a
// rm -r -f test;oj dl http://abc126.contest.atcoder.jp/tasks/abc126_a

Submission status: Runtime Error

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

if 12<a:
    if 0<b<=12:
        ans='YYMM'
    else:
        ans='NA'

elif 0<a<=12:
    if 0<b<=12:
        ans='AMBIGUOUS'
    else:
        ans='MMYY'

print(ans)

Submission status: Runtime Error

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

if 12<a:
    if 0<b<=12:
        ans='YYMM'
    else:
        ans='NA'

elif 0<a<=12:
    if 0<b<=12:
        ans='AMBIGUOUS'
    elif 12<b:
        ans='MMYY'

print(ans)

Submission status: Runtime Error

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

if 12<a:
    if 0<b<=12:
        ans='YYMM'
    elif 0>b and 12<b:
        ans='NA'

elif 0<a<=12:
    if 0<b<=12:
        ans='AMBIGUOUS'
    elif 12<b:
        ans='MMYY'

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
A = int(S[0:2])
B = int(S[2:4])

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

Submission status: Runtime Error

Solution code:
s = input()
if s[0] == 0:
    mae = int(s[1])
else:
    mae = int(s[:2])
if s[2] == 0:
    usiro int(s[3])
else:
    usiro = int(s[2:])
if 12 >= mae:
    if 12 >= usiro:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 12 >= usiro:
    print("YYMM")
else:
    print("NA")

Submission status: Runtime Error

Solution code:
import bisect

lis = [1, 12]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tp == 0:
    if bt == 1:
        jd = 3
    else:
        jd == 0
elif tp == 1:
    if bt == 1:
        jd == 2
    else:
        jd == 1
else:
    if bt == 1:
        jd == 0
    else:
        jd == 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(judge[jd])

Submission status: Runtime Error

Solution code:
import bisect

lis[1, 12]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tp == 0:
    if bt == 1:
        jd = 3
    else:
        jd == 0
elif tp == 1:
    if bt == 1:
        jd == 2
    else:
        jd == 1
else:
    if bt == 1:
        jd == 0
    else:
        jd == 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(judge[jd])

Submission status: Runtime Error

Solution code:
S = input().rstrip()
S = input().rstrip()
be = int(S[:2])
en = int(S[2:])
flag_be = False
flag_en = False
answer = ""
if be <= 12 and be >= 1:
    flag_be = True
if en <= 12 and en >= 1:
    flag_en = True

if flag_be and flag_en:
    answer = "AMBIGUOUS"
elif flag_be == True and flag_en == False:
    answer = "MMYY"
elif flag_be == False and flag_en == True:
    answer = "YYMM"
else:
    answer = "NA"
print(answer)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import bisect

lis[1, 12]

str = input()
tp = int(str[:2])
bt = int(str[2:])
if

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tp == 0:
    if bt == 1:
        jd = 3
    else:
        jd == 0
elif tp == 1:
    if bt == 1:
        jd == 2
    else:
        jd == 1
else:
    if bt == 1:
        jd == 0
    else:
        jd == 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(judge[jd])

Submission status: Runtime Error

Solution code:
a = int(input())
y = a//100
m = a%100
if y <= 12 and y >= 1:
	if m <= 12 and n >= 1:
    	print('AMBIGUOUS')
    else:
     	print('MMYY')
else:
	if m <= 12 and n >= 1:
    	print('YYMM')
    else:
     	print('NA')

Submission status: Runtime Error

Solution code:
a = int(input())
y = a//100
m = a%100
if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')

Submission status: Runtime Error

Solution code:
def hantei(y,m):
    if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')
a = input()
b1 = int(a[0:2])
c2 = int(a[2:4])
henkan(b1,c2)

Submission status: Runtime Error

Solution code:
def hantei(y,m):
    if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('YYMM')
    else:
        if m <= 12 and n >= 1:
            print('MMYY')
        else:
            print('NA')
a = input()
b1 = int(a[:2])
c2 = int(a[2:])
hantei(b1,c2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def isM(s):
    return 1<=int(s)<=12

if __name__ == '__main__':
    input = sys.stdin.read()
    F, S = input[:2], input[2:]
    if isM(F) and not isM(S): print "MMYY"
    elif not isM(F) and isM(S): print "YYMM"
    elif isM(F) and isM(S): print "AMBIGUOUS"
    else: print 'NA'

Submission status: Runtime Error

Solution code:
def main():
    S = input()
    upper = int(S[:2])
    lower = int(S[2:4])

    if upper > 12 and lower > 12:
        print('NA')

    elif upper > 12 and lower > 0:
        print('YYMM')

    elif lower > 12 and upper > 0:
        print('MMYY')

    elif lower == 0 or upper == 0:
        print('NA')

    else:
        print('AMBIGUOUS')

    else:
        print('NA')


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def mounth(a):
  if 1<=a<=12:
    return 1
  else:
    return 0
  
def year(b):
  if b = 0:
    return 1
  else:
    return 0
  
S = input()
pre, poset = int(S[:2]), int(S[2:])
ans = [month(pre) * year(post), month(post) * year(pre)]
if ans[0] ==1 & ans[1] == 1:
  print("AMBIGUOUS")
elif ans[0] == 1 & ans[1] == 0:
  print("MMYY")
elif ans[1] == 0 & ans[0] == 1:
  print("YYMM")
else:
  print("NA")

Submission status: Runtime Error

Solution code:
s = list(str(input()))
a = int(s[0]+s[1])
b = int(s[2]+s[3])
if 0 < a < 13:
    if 0 < b < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")

else:
    if 0 < b < 13:
        print("YYMM")
    else:
        print("NA")
print(ans)

Submission status: Runtime Error

Solution code:
s = list(str(input()))
A = int(s[0]+s[1])
B = int(s[2]+s[3])
if 0 < a < 13:
    if 0 < b < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")

else:
    if 0 < b < 13:
        print("YYMM")
    else:
        print("NA")
print(ans)

Submission status: Runtime Error

Solution code:
s=input();print['NA','MMYY','YYMM','AMBIGUOUS'][(99<s<1300)-(0<s%100<13)*2]

Submission status: Runtime Error

Solution code:
a=int(input())
if int(a[0])==0 and a[1]==0:
  print('NA')
elif int(a[2])==0 and a[3]==0:
  print('NA')
elif int(a[0])>=2:
  print ('YYMM')
elif int(a[0])>=1 and a[1]>=3:
  print('YYMM')
elif int(a[2])>=2:
  print ('MMYY')
elif int(a[2])>=1 and a[3]>=3:
  print('MMYY')

Submission status: Runtime Error

Solution code:
s = input()
if s[0] == 0:
    mae = int(s[1])
else:
    mae = int(s[:2])
if s[2] == 0:
    usiro int(s[3]
else:
    usiro = int(s[2:])
if 12 >= mae:
    if 12 >= usiro:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 12 >= usiro:
    print("YYMM")
else:
    print("NA")

Submission status: Runtime Error

Solution code:
a=int(input())
if a[0]==0 and a[1]==0:
  print('NA')
elif a[2]==0 and a[3]==0:
  print('NA')
elif a[0]>=2:
  print ('YYMM')
elif a[0]>=1 and a[1]>=3:
  print('YYMM')
elif a[2]>=2:
  print ('MMYY')
elif a[2]>=1 and a[3]>=3:
  print('MMYY')

Submission status: Runtime Error

Solution code:
from sys import stdin
S = stdin.readline().rstrip()
zen, kou = S[:2], S[2:]
if 1 <= zen <= 12:
  if 1 <= kou <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if 1 <= kou <= 12:
    print('YYMM')
  else:
    print('NA')

Submission status: Runtime Error

Solution code:
n=input()
n1=n[:2]
n2=n[2:4]
A=int(n1)
B=int(n2)
elif 1<=A and A<=12:
    if 1<=B and B<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1<=B and B<=12:
        print("YYMM")
    else:
        print("NA")

Submission status: Runtime Error

Solution code:
S = list(str())
pat1 = "YYMM"
pat2 = "MMYY"
pat3 = "AMBIGOUS"
pat4 = "NA"
mae =int(S[0] + S[1])
usiro = int(S[2] + S[3])
print(mae)
print(usiro)
if mae >= 13:
    if usiro >= 13:
        print(pat4)
    elif usiro != 0:
        print(pat1)
elif mae != 0:
    if usiro == 0:
        print(pat2)
    else:
        print(pat1)
else:
    if usiro >= 13 or usiro == 0:
        print(pat4)
    else:
        print(pat1)

Submission status: Runtime Error

Solution code:
def hantei(y,m):
    if str(y) == '00' or str(m) == '00':
        print('NA')
        if m > 12:
            print('YYMM')
        else:
            print('MMYY')
    else:
        print('AMBIGUOUS')


a = input()
b = 0
b1 = int(a[:2])
c2 = int(a[2:])
henkan(b1,c2)

Submission status: Runtime Error

Solution code:
map=input()

s = list(map)
str(m)
def m(x,y):
  if x==0:
    if y!=0:
      m=yes
  if x==1:
    if 0<y<2:
      m=yes
    
  m(s[0],s[1])
    
if m==yes:
  m(s[2],s[3])
  if m==yes:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  m(s[2],s[3])
  if m==yes:
    print("YYMM")
  else:
    print("NA")

Submission status: Runtime Error

Solution code:
S = input()
S1 = S[:1]
S2 = S[2:]
month = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']

if S1 in month and S2 in month:
	print('AMBIGUOUS')
elif S1 in month:
	print('MMYY')
elif S2 in month:
	print('YYMM')
elif S1 == '00': 
	print('YYMM')
elif: S2 == '00':
	print('MMYY')
else:
	print('NA')

Submission status: Runtime Error

Solution code:
S = input()
S1 = S[:1]
S2 = S[2:]
month = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']

if S1 in month and S2 in month:
	print('AMBIGUOUS')
elif S1 in month:
	print('MMYY')
elif S2 in month:
	print('YYMM')
elif S1 == '00': 
	print('MMYY')
elif: S2 == '00':
	print('YYMM')
else:
	print('NA')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

# 文字列の入力
#s = input()
# 文字列のlist化
s = list(input())

#対象箇所 be
be = s[0:2]
#対象箇所 af
af = s[2:4]

#print(be)
#print(af)
if (0 < be or be < 13) and (1 > af or af>13):
	print('YYMM')
elif (0 > be or be > 13) and (1 > af or af > 13):
	print('MMYY')
elif (0 < be and be < 13) and (0 < af and af < 13):
	print('AMBIGUOUS')
else :
	print('NA')

Submission status: Runtime Error

Solution code:

ans=""
S=input()
s1=S[:2]
s2=S[2:]
n1=int(s1)
n2=int(s2)

if (n1>12 and n2>12) or (n1==0 and n2==0) or (n1>12 and n2==0) or (n1==0 and n2>12):
    ans="NA"
elif (n1>12 or n1==0) and (n2<=12 and not n2==0):
    ans="YYMM"
elif (n1<=12 not n1==0) and (n2>12 or n2==0):
    ans="MMYY"
elif n1<=12 and n2<=12:
    ans="AMBIGUOS"


print(ans)

Submission status: Runtime Error

Solution code:
a=input()
if a[0]==0 and a[1]==0:
  print('NA')
elif a[2]==0 and a[3]==0:
  print('NA')
elif a[0]>=2:
  print ('YYMM')
elif a[0]>=1 and a[1]>=3:
  print('YYMM')
elif a[2]>=2:
  print ('MMYY')
elif a[2]>=1 and a[3]>=3:
  print('MMYY')

Submission status: Runtime Error

Solution code:
#coding:utf-8
S = input()
a = ["0","1","2","3","4","5","6","7","8","9"]
b = ["0","1","2","3","4","5","6","7","8","9"]
c = ["01","02","03","04","05","06","07","08","09","10","11","12"]
if S ==random.choice(a)+random.choice(b)+random.choice(c):
    print(YYMM)
elif S ==random.choice(a)+random.choice(b)+random.choice(c):
    print(MMYY)

Submission status: Runtime Error

Solution code:
S = 1905

S = 1000a + 100b + 10c + d

if (0 < a < 9
and 0 < b < 9
and 0 < c < 1
and :
print 'YYMM'

Submission status: Runtime Error

Solution code:
S = input()

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

elif int(S[0:2]) >= 13 and int(S[0:2]) == 0:
    if int(S[2:4]) == 0:
        print("NA")

elif int(S[2:4]) >= 13 and int(S[2:4]) == 0
    if int(S[0:2]) == 0:
        print("NA")

Submission status: Runtime Error

Solution code:
S = input()

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

elif int(S[0:2]) >= 13 and int(S[0:2]) == 0:
    if int(S[2:4]) == 0:
        print("NA")

elif int(S[2:4]) >= 13: and int(S[2:4]) == 0
    if int(S[0:2]) == 0:
        print("NA")

Submission status: Runtime Error

Solution code:
import numpy as np
import fractions

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

Submission status: Runtime Error

Solution code:
S = str(input())

front = int(S[:2])
back = int(S[2:4])

if front > 12 and back > 0 and back <= 12:
    print('YYMM')
elif front <=12 and front > 0 and back > 12:
    print('MMYY')
elif front == 0 or end == 0:
    print('NA')
else:
    print('AMBIGUOUS')

Submission status: Runtime Error

Solution code:
S = input()

E1 = int(S[:2])
E2 = int(S[2:])

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
hoge = str(input())
a = int(hoge[:2])
b = int(hoge[2:4])

if 0 < a and a <= 12:
  result = "MMYY"
  if 0 < b and b <= 12:
    result = "AMBIGUOUS"
if 0 < b and b <= 12:
  result = "YYMM"
  if 0 < a and a <= 12:
    result = "AMBIGUOUS"
if result == None:
  result = "NA"

print(result)

Submission status: Runtime Error

Solution code:
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("MMYY")
  else:
    if(0<a//100<13):
      print("YYMM")
    else:
      print("NA")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=int(input())

a=S/100
b=S%100

if(a>12 and b>12):
    print("NA")

elif(a==0 and b==0):
    print("NA")

elif((a>12 or a=0) and 1<=b<=12):
        print("YYMM")

elif(1<=a<=12 and (b>12 or b=0)):
        print("MMYY")

elif(1<=a<=12 and 1<=b<=12):
        print('AMBIGUOU')

else:
    print("NA")

Submission status: Runtime Error

Solution code:
N = int(input())
Moji = str(N)
Mae = int(Moji[:2])
Ato = int(Moji[2:])

if (Mae == 0 or Mae >= 13) and (Ato == 0 or Ato >= 13):
    print("NA")
elif not (Mae == 0 or Mae >= 13) and  not (Ato == 0 or Ato >= 13):
    print("AMBIGUOUS")
elif (Mae == 0 or Mae >= 13) and  not (Ato == 0 or Ato >= 13):
    print("YYMM")
else:
    print("MMYY")

Submission status: Runtime Error

Solution code:
s = int(input())

b = s % 100
a = int((s-b)/100)

if a ==0 or b == 0:
    print(‘NA’)
elif a> 12 and b>12:
    print(‘NA’)
elif a>12:
    print(‘YYMM’)
elif b>12:
    print(‘MMYY’)
else:
    print(‘AMBIGUOUS’)

Submission status: Runtime Error

Solution code:
hoge = str(input())
a = int(hoge[:2])
b = int(hoge[2:4])

if 0 < a and a < 12:
  result = "YYMM"
  if 0 < b and b < 12:
    result = "AMBIGUOUS"
if 0 < b and b < 12:
  result = "MMYY"
  if 0 < a and a < 12:
    result = "AMBIGUOUS"
if result == None:
  result = "NA"

print(result)

Submission status: Runtime Error

Solution code:
# coding: utf-8
s = input()
s_list=list(s)
s_len=len(s_list)
s_first=int(s_list[0]+s_list[1])
s_second=int(s_list[2]+s_list[3])
if s_first<13:#MMYY case
    if s_second<13:
        print('AMBIGOUS')
    else:
        print('MMYY')

else if: #YYMM case
    if s_second==0:
        print('NA')
    else:
        print('YYMM')

else
    print('NA')

Submission status: Runtime Error

Solution code:
s = int(input())

b = s % 100
a = int((s-b)/100)

if a ==0 or b == 0
    print(‘NA’)
elif a> 12 and b>12
    print(‘NA’)
elif a>12
    print(‘YYMM’)
elif b>12
    print(‘MMYY’)
else
    print(‘AMBIGUOUS’)

Submission status: Runtime Error

Solution code:
def solve():
    S= input()
    ue = int(S[:2])
    sita = int(S[2:])

    if 1 <= sita <= 12 and not(1 <= ue <= 12):
        print("YYMM")
    elif (not (1 <= ue <= 12)) and 1 <= sita <= 12:
        print("MMYY")
    elif (not (1 <= ue <= 12)) and (not (1 <= sita <= 12)):
        print("NA")
    elif 1 <= sita <= 12 and (1 <= ue <= 12):
        print("AMBIGUOUS")
    else:
        raise "ERROR"
if __name__ == "__main__":
    solve()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
sstr=list(input())
s=[int(n) for n in sstr]
sf=[s[0],s[1]]
sb=[s[2],s[3]]
if sf[0]==0:
  sf.pop(0)
if sb[0]==0:
  sb.pop(0)
fw="".join(sf)
bk="".join(sb)
if 1<=fw<=12:
  if 1<=bk<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1<=bk<=12:
    print("YYMM")
  else:
    print("NA")

Submission status: Runtime Error

Solution code:
sstr=list(input())
s=[int(n) for n in sstr]
sf=[s[0],s[1]]
sb=[s[2],s[3]]
fw="".join(sf)
bk="".join(sb)
if fw[0]==0:
  fw.pop(0)
if bk[0]==0:
  bk.pop(0)
if 1<=fw<=12:
  if 1<=bk<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1<=bk<=12:
    print("YYMM")
  else:
    print("NA")

Submission status: Runtime Error

Solution code:
hoge = str(input())
a = int(hoge[:2])
b = int(hoge[2:4])

if 0 < a and a < 12:
  result = "YYMM"
  if 0 < a and a < 12:
    result = "AMBIGUOUS"
if 0 < b and b < 12:
  result = "MMYY"
  if 0 < a and a < 12:
    result = "AMBIGUOUS"
if result == None:
  result = "NA"

print(result)

Submission status: Runtime Error

Solution code:
N = int(input())
Moji = str(N)
Mae = int(Moji[:2])
Ato = int(Moji[2:])

if (Mae == 0 or Mae >= 13) and (Ato == 0 or Ato >= 13):
    print("NA")
elif not (Mae == 0 or Mae >= 13) and  not (Ato == 0 or Ato >= 13):
    print("AMBIGUOUS")
elif (Mae == 0 or Mae >= 13) and  not (Ato == 0 or Ato >= 13):
    print("YYMM")
elif not (Mae == 0 or Mae >= 13) and (Ato == 0 or Ato >= 13):
    print("MMYY")

Submission status: Runtime Error

Solution code:
S=int(input())
month=S%100
year=(S-S%100)//100
if (month!=0 and month<=12) and (year!=0 and year<=12):
  print(AMBIGUOUS) 
elif (month!=0 and month<=12) and year!=0:
  print(MMYY) 
elif month!=0 and (year!=0 and year<=12):
  print(YYMM)
else:
  print(NA)

Submission status: Runtime Error

Solution code:
hoge = str(input())
a = int(hoge[:2])
b = int(hoge[2:4])

if a == 0 or b == 0:
  result = "NA"

if 0 < a and a < 12:
  result = "YYMM"
  if 0 < a and a < 12:
    result = "AMBIGUOUS"
if 0 < b and b < 12:
  result = "MMYY"
  if 0 < a and a < 12:
    result = "AMBIGUOUS"

print(result)

Submission status: Runtime Error

Solution code:
S=int(input())
month=S%100
year=(S-S%100)//100
if (month!=0 and month<=12) and (year!=0 and year<=12):
	print(AMBIGUOUS) 
elif (month!=0 and month<=12) and year!=0: 
    print(MMYY) 
elif month!=0 and (year!=0 and year<=12):
	print(YYMM)
else:
	print(NA)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = str(input())
F = int(S[0:2])
T = int(S[2:4])

def Greaterthan12(x):
    if x > 12:
        return 0
    else:
        return 1
        
Fjudge = BorS(F)
Tjudge = BorS(T)
if Fjudge == 0:
    if Tjudge == 0:
        print("NA")
    else:
        print("YYMM")
else:
    if Tjudge == 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")

Submission status: Runtime Error

Solution code:
if A == 0 & B == 0:
    print('NA')
elif 1 <= A <= 12:
    if 1 <= B <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif 1 <= B <= 12:
    if 1 <= A <= 12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    print('NA')

Submission status: Runtime Error

Solution code:
S=int(input())
month=S%100
year=(S-S%100)//100
if (month!=0 and month<=12) and (year!=0 and year<=12):
	print(AMBIGUOUS) 
else if (month!=0 and month<=12) and year!=0: 
    print(MMYY) 
else if month!=0 and (year!=0 and year<=12):
	print(YYMM)
else:
	print(NA)

Submission status: Runtime Error

Solution code:
N = int(input())
print(N)
Moji = str(N)
Mae = int(Moji[:2])
Ato = int(Moji[2:])

if (Mae == 0 or Mae >= 13) and (Ato == 0 or Ato >= 13):
    print("NA")
elif not (Mae == 0 or Mae >= 13) and  not (Ato == 0 or Ato >= 13):
    print("AMBIGUOUS")
elif (Mae == 0 or Mae >= 13) and  not (Ato == 0 or Ato >= 13):
    print("YYMM")
elif not (Mae == 0 or Mae >= 13) and (Ato == 0 or Ato >= 13):
    print("MMYY")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=int(input())
num=[]
while s > 0:
    num.append(s % 100)
    s //= 100

num.reverse()

if num[0]<=12 and num[0]>0:
    if num[1]<=12 and num[1]>0:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if num[1]<=12 and num[1]>0:
        print("YYMM")
    else:
        print("NA")