course à trois jambes france ioi
nbParticipants=int(input())
participant=[0]*nbParticipants
for i in range (nbParticipants):
participant[i]=int(input())
participant.sort()
for i in range (nbParticipants//2):
print("{} {}".format(min(participant),(max(participant))))
participant.pop(0)
participant.pop()