T = int(input()) for i in range(T): A = list(map(int,input().split())) print(max(A)-min(A))