import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; void main() { auto n = readln.chomp.to!size_t; auto si = iota(n).map!(_ => readln.chomp ~ "|").array; auto hi = si.heapify!("a > b"); auto s = ""; while (hi.front[0] != '|') { auto a = hi.front; s ~= a[0]; hi.replaceFront(a[1..$]); } writeln(s); }