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