It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.   There are N houses along _TopCoDeer street_. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.   Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
a = list(sorted(map(int, input().split())))
print(a[-1] - a[0])
N = int(input())
a = list(sorted(map(int, input().split())))
print(a[-1] - a[0])