import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List list = new ArrayList<>(); for(int i=0; i list) { int max = list.get(list.size()-1) - list.get(0); System.out.println(max); } static void printMin(List list) { int min = list.get(list.size()-1) - list.get(0); for(int i=1; i