for i=0to 999 input""a$ b=val(a$) ?a$; if b>0and 12>b?" AM"; if 12=b?" PM"; ?next