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