program simulator;
var
a:array[0..10001]of longint;
b:array[0..10001]of real;
i,j,v,c,n,cc,vv,w:longint;
s:char;
ans:real;
begin
assign(input,'simulator.in');
assign(output,'simulator.out');
reset(input);
rewrite(output);
readln(cc,vv);
a[0]:=cc; b[0]:=(cc*vv)/100;
readln(n);
for i:=1 to n do begin
read(s);
if s='p' then begin
readln(c,v);
a[i]:=a[i-1]+c;
b[i]:=b[i-1]+(c*v)/100;
end
else begin
a[i]:=a[i-2];
b[i]:=b[i-2];
end;
end;
for i:=1 to n do
writeln (a[i],' ',b[i]/a[i]*100:0:5);
close(input); close(output);
end.