uses wincrt;

var nome, email, matricula, turma, professor, q: string;
    nota: integer;

var arq, arqsai: text;

const
    resp: array [1..10] of string =
        (
        '5',
        'D',
        'C',
        'D',
        'D',
        'B',
        'C',
        'C',
        'E',
        'C'
    );

procedure processaProva;
var i, n, erro, x: integer;
begin
    nota := 0;

    readln (arq);
    readln (arq, nome);
    delete (nome, 1, 18);

    readln (arq, email);
    delete (email, 1, 18);

    readln (arq, matricula);
    delete (matricula, 1, 18);

    readln (arq, turma);
    delete (turma, 1, 18);

    for i := 1 to 10 do
        begin
             readln (arq, q);
             val (copy (q, 2, 2), n, erro);
             if n <> i then
                  begin
                      writeln ('erro no aluno ', nome);
                      readln;
                      break;
                  end;

             delete (q, 1, 18);
             while (q <> '') and (q[1] = ' ') do delete (q, 1, 1);
             while (q <> '') and (q[length(q)] = ' ') do delete (q, length(q), 1);
             for x := 1 to length (q) do
                  q[x] := upcase (q[x]);

             if q <> resp[i] then
                  writeln (arqsai, i:2, ' ', q, ' ---> ', resp[i])
             else
                 nota := nota + 1;
        end;

    writeln (arqsai, turma:2,
                     '    ',
                     copy (nome+'                                   ', 1, 40),
                     '    ',
                     copy (matricula+'                 ', 1, 12),
                     '    ',
                     nota);

    writeln (arqsai);
    readln (arq);
    readln (arq);
end;

var s: string;
begin
    assign (arq, 'c:\provaes2');
    reset (arq);
    assign (arqsai, 'c:\provasai');
    rewrite (arqsai);

    while not eof (arq) do
        begin
            repeat
                if eof (arq) then break;
                readln (arq, s);
            until s = 'Informações fornecidas pelo usuário:';

            if not eof (arq) then
                processaProva;
        end;

    close (arq);
    close (arqsai);
    doneWinCrt;
end.