import std.stdio, std.string, std.conv, std.range, std.array, std.algorithm; import std.uni, std.math, std.container, std.typecons, std.typetuple; import core.bitop, std.datetime; void main(){ auto n = readln.chomp.to!int; auto a = readln.split.to!(int[]); foreach(i ; 1 .. 2*n - 3){ foreach(p ; 0 .. (i+1)/2){ int q = i - p; if(p != q && 0 <= q && q < n){ if(a[p] > a[q]){ swap(a[p], a[q]); } } } } writefln("%(%s %)", a); } void readVars(T...)(auto ref T args){ auto line = readln.split; foreach(ref arg ; args){ arg = line.front.to!(typeof(arg)); line.popFront; } if(!line.empty){ throw new Exception("args num < input num"); } }