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