s = input()
ans = {(False, False): 'NA', (False, True): 'YYMM', (True, False): 'MMYY', (True, True): 'AMBIGUOUS'}
print(ans[1 <= int(s[:2]) <= 12, 1 <= int(s[2:]) <= 12]) s = input() s input() input ans = {(False, False): 'NA', (False, True): 'YYMM', (True, False): 'MMYY', (True, True): 'AMBIGUOUS'} ans {(False, False): 'NA', (False, True): 'YYMM', (True, False): 'MMYY', (True, True): 'AMBIGUOUS'} (False, False) (False, False) False False 'NA' (False, True) (False, True) False True 'YYMM' (True, False) (True, False) True False 'MMYY' (True, True) (True, True) True True 'AMBIGUOUS' print(ans[1 <= int(s[:2]) <= 12, 1 <= int(s[2:]) <= 12]) print ans[1 <= int(s[:2]) <= 12, 1 <= int(s[2:]) <= 12] ans 1 <= int(s[:2]) <= 12 1 <= int(s[:2]) 1 int(s[:2]) int s[:2] s :2 2 12 s = input() input() s ans = {(False, False): 'NA', (False, True): 'YYMM', (True, False): 'MMYY', (True, True): 'AMBIGUOUS'} {(False, False): 'NA', (False, True): 'YYMM', (True, False): 'MMYY', (True, True): 'AMBIGUOUS'} ans
s = input()
ans = {(False, False): 'NA', (False, True): 'YYMM', (True, False): 'MMYY', (True, True): 'AMBIGUOUS'}
print(ans[1 <= int(s[:2]) <= 12, 1 <= int(s[2:]) <= 12])