uses crt;
type rational=record
ch,zn:longint;
end;
var a:array [1..100] of rational;
f:text;
i,j,n:integer;
x:rational;
begin
clrscr;
assign(f, 'ratio.txt');
reset(f);
n:=0;
while not(eof(f)) do
begin
inc(n);
readln(f, a[n].ch, a[n].zn);
end;
close(f);
for i:=1 to n-1 do
for j:=i+1 to n do
if a.ch/a.zn>a[j].ch/a[j].zn then
begin
x:=a;
a:=a[j];
a[j]:=x
end;
for i:=1 to n do
write(a.ch,'/',a.zn,' ');
readln
end.