T = int(input()) for _ in [0]*T: L = list(map(int,input().split())) print(max(L)-min(L))