import sys
import math
import collections
input = sys.stdin.readline
def 평균(numbers):
return round(sum(numbers) / len(numbers))
def 중앙값(numbers):
return numbers[len(numbers) // 2]
def 최빈값(board):
result = []
target = max(board.values())
for key, value in board.items():
if value == target:
result.append(key)
if len(result) == 1:
return result[0]
return sorted(result)[1]
def 범위(numbers):
return 0 if len(numbers) == 1 else max(numbers) - min(numbers)
board = collections.defaultdict(int)
n = int(input().rstrip())
numbers = sorted([int(input()) for _ in range(n)])
for number in numbers:
board[number] += 1
print(평균(numbers))
print(중앙값(numbers))
print(최빈값(board))
print(범위(numbers))