import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
{
Scanner in
= new Scanner
(System.
in); TreeMap
<Double, String
> map
= new TreeMap
<>(); int n = in.nextInt();
for(int i = 1; i <= n; i++) {
double item = in.nextDouble();
if(map.
get(item
) == null) map.
put(item,
Integer.
toString(i
)); else {
map.put(item, str);
}
}
while(map.size() != 1) {
double x = map.firstKey();
char numx = '0';
if(strX.length() == 1) {
map.remove(x);
numx = strX.charAt(0);
}
else {
numx = strX.charAt(0);
map.put(x, strX.substring(1));
}
double y = map.firstKey();
char numy = '0';
if(strY.length() == 1) {
map.remove(y);
numy = strY.charAt(0);
}
else {
numy = strY.charAt(0);
map.put(y, strY.substring(1));
}
int numXInt
= Character.
getNumericValue(numx
); int numYInt
= Character.
getNumericValue(numy
); System.
out.
println(Math.
min(numXInt, numYInt
) + " " + Math.
max(numXInt, numYInt
)); double newKey = (x + y) / 2;
if(map.
get(newKey
) == null) map.
put(newKey,
Integer.
toString(++n
)); else {
map.put(newKey, str);
}
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCVRyZWVNYXA8RG91YmxlLCBTdHJpbmc+IG1hcCA9IG5ldyBUcmVlTWFwPD4oKTsKCQlpbnQgbiA9IGluLm5leHRJbnQoKTsKCQlmb3IoaW50IGkgPSAxOyBpIDw9IG47IGkrKykgewoJCQlkb3VibGUgaXRlbSA9IGluLm5leHREb3VibGUoKTsKCQkJaWYobWFwLmdldChpdGVtKSA9PSBudWxsKSBtYXAucHV0KGl0ZW0sIEludGVnZXIudG9TdHJpbmcoaSkpOwoJCQllbHNlIHsKCQk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