let t = stdin.ReadLine() |> int for i = 1 to t do stdin.ReadLine().Split() |> Array.map int |> fun xs -> Array.max xs - Array.min xs |> printfn "%d"