//прога на Pascal`е
var
a: array of longint;
n, i: longint;
//
procedure zam(var a, b: longint);
var pz: longint;beginpz:=a;a:=b;b:=pz;end;
procedure selectsort (rm : longint; var sortmas: array of longint);vari, j, min: longint;begin for i:=0 to rm-2 dobeginmin:=i;for j:=i to rm-1 doif sortmas[min]>sortmas[j] then min:=j; if i<>min then zam (sortmas[i], sortmas[min]);end;
end;//
beginrandomize;
readln (n);
setLength (a, n);for i:=0 to n-1 doa[i]:=random (2*1000000000) - 1000000000;writeln (a);selectsort (n, a);writeln (a);
end.