if __name__ == '__main__':
    data_num = int(input())
    data = [int(x) for x in input().split(' ')]
    assert data_num == len(data), "invalid input"

    print('{0} {1} {2}'.format(min(data), max(data), sum(data)))
d73af2c4c5511416c0f787cfb4f4302b83803ec8
<mask token>

if __name__ == '__main__':
    data_num = int(input())
    data = [int(x) for x in input().split(' ')]
    assert data_num == len(data), 'invalid input'
    print('{0} {1} {2}'.format(min(data), max(data), sum(data)))

if __name__ == '__main__':
    data_num = int(input())
    data = [int(x) for x in input().split(' ')]
    assert data_num == len(data), "invalid input"

    print('{0} {1} {2}'.format(min(data), max(data), sum(data)))