import algorithm, strutils, sequtils let n: int = stdin.readLine.parseInt var aaa: seq[int] = stdin.readLine.split.map(parseInt) aaa.sort(system.cmp[int]) var index = 0 if aaa.len mod 2 != 0: index = int(aaa.high/2) echo aaa[index] else: index = int(aaa.high/2) echo (aaa[index] + aaa[index+1])/2