Program F777;
varX:array[1..102] of integer;mult,max,i,num:integer;
begin for i:=1 to 6 do readln(x[i]); max:=x[1]; for i:=1 to 6 do if max < x[i] then begin max:=x[i]; num:=i; end; num:=num+1; mult:=1; for i:=num to 6+num do begin if i = 6- num then x[mult]:=0 else x[mult]:=x[i]; mult:=mult+1; end; x.Print(' '); end.