read B
B=${B#0}
B=${B#0}
B=${B#0}
B=${B#0}
A=$[B/100]
B=$[B%100]
if [ $A -gt 0 -a $A -lt 13 ];then
	if [ $B -gt 0 -a $B -lt 13 ];then
		echo AMBIGUOUS
	else
		echo MMYY
	fi
else
	if [ $B -gt 0 -a $B -lt 13 ];then
		echo YYMM
	else
		echo NA
	fi
fi
