import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); for(int i = 0 ; i < t ; i++){ int[] size = new int[5]; for(int j = 0 ; j < size.length; j++){ size[j] = scan.nextInt(); } Arrays.sort(size); System.out.println(size[4] - size[0]); } } }