#!/usr/local/gnu/bin/bash
n=`sed -r "s/^0+//"`
n1=$((n/100))
n2=$((n%100))
if((1<=n1&&n1<=12))
then
    ((1<=n2&&n2<=12)) && echo AMBIGUOUS || echo MMYY
else
    ((1<=n2&&n2<=12)) && echo YYMM || echo NA
fi
