// PascalABC.NET 3.6.3
begin
var n := ReadInteger;
var a := ArrRandom(n, -99, 99);
a.Println;
var ai := a.Indices((v, i) -> v.IsEven).ToArray;
var vi := ai.Select(p -> a[p]).Order.ToArray;
for var i := 0 to ai.High do
a[ai[i]] := vi[i];
a.Print
end.
// PascalABC.NET 3.6.3
begin
var n := ReadInteger;
var a := ArrRandom(n, -99, 99);
a.Println;
var ai := a.Indices((v, i) -> v.IsEven).ToArray;
var vi := ai.Select(p -> a[p]).Order.ToArray;
for var i := 0 to ai.High do
a[ai[i]] := vi[i];
a.Print
end.