This is my code:
=================
type mt=record
c: char;
f: longint;
end;
var a: array[32..128] of mt;
j,k,fr: integer;
ch,symb: char;
cases,first: longint;
begin
cases:=0;
repeat
inc(cases);
if cases<>1 then begin writeln; writeln; end;
fillchar(a,sizeof(a),0);
repeat
read(symb);
a[ord(symb)].c:=symb;
a[ord(symb)].f:=a[ord(symb)].f+1;
until eoln;
for j:=32 to 127 do
for k:=j+1 to 128 do
if a[j].f>a[k].f then
begin
fr:=a[j].f;
ch:=a[j].c;
a[j].f:=a[k].f;
a[j].c:=a[k].c;
a[k].f:=fr;
a[k].c:=ch;
end else
if (a[j].f=a[k].f)and(ord(a[j].c)<ord(a[k].c)) then
begin
fr:=a[j].f;
ch:=a[j].c;
a[j].f:=a[k].f;
a[j].c:=a[k].c;
a[k].f:=fr;
a[k].c:=ch;
end;
first:=1;
for j:=32 to 128 do
if a[j].f<>0 then
begin
if (first=1) then begin write(ord(a[j].c),' ',a[j].f); first:=0; end
else begin writeln; write(ord(a[j].c),' ',a[j].f); end;
end;
if not(eof(input)) then readln;
until eof(input);
end.
=======================
I don't put a blank line after the output, but it's still p.e.

why?