{ NOTA: si raccomanda di usare questo template anche se non lo si capisce completamente }

const
    MAXQ = 300000;

var
    M, N, Q, T, i, test : LongInt;
    S, ans              : AnsiString;
    qtype               : Array[0..MAXQ-1] of Char;
    a, b                : Array[0..MAXQ-1] of LongInt;

begin
{
    decommenta le due righe seguenti se vuoi leggere/scrivere da file
    assign(input,  'input.txt');  reset(input);
    assign(output, 'output.txt'); rewrite(output);
}

    ReadLn(T);
    for test:=1 to T do begin
        ReadLn();
        ReadLn(N, M, Q);

        ReadLn(S);

        for i:=0 to Q-1 do
            ReadLn(qtype[i], a[i], b[i]);

        ans := '';

        { INSERISCI IL TUO CODICE QUI }


        Write('Case #', test, ': ');
        WriteLn(ans);
    end;

end.
