Const
     mes: array [1..12] of string =
          ('ENERO', 'FEBRERO', 'MARZO', 'ABRIL', 'MAYO', 'JUNIO',
           'JULIO', 'AGOSTO', 'SEPTIEMBRE', 'OCTUBRE', 'NOVIEMBRE', 'DICIEMBRE');

Var
   s: string;
   i,n: longint;
   rfc: string[10];

Begin
     readln(input, s);
     rfc[4]:= upcase(s[1]);
     readln(input, s);
     rfc[1]:= upcase(s[1]);
     for i:= 2 to length(s) do
         if s[i] in ['a','e','i','o','u','A','E','I','O','U'] then
            begin
            rfc[2]:= upcase(s[i]);
            break;
            end;
     readln(input, s);
     rfc[3]:= upcase(s[1]);
     readln(input, n, s);
     rfc[5]:= s[length(s)-1];
     rfc[6]:= s[length(s)];
     rfc[9]:= char((n div 10) + 48);
     rfc[10]:= char((n mod 10) + 48);
     for i:= 1 to length(s) do
         s[i]:= upcase(s[i]);
     for i:= 1 to 12 do
         if (pos(mes[i], s) <> 0) then
            begin
            rfc[7]:= char((i div 10) + 48);
            rfc[8]:= char((i mod 10) + 48);
            break;
            end;
     rfc[0]:= char(10);
     writeln(output, rfc);
End.

