t = int(input()) for i in range(t): v = [int(v) for v in input().split()] print(max(v) - min(v))