import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int min = Integer.MAX_VALUE; int[] xArr = new int[n]; int[] yArr = new int[n]; for (int i = 0; i < n; i++) { xArr[i] = sc.nextInt(); } for (int i = 0; i < n; i++) { yArr[i] = sc.nextInt(); min = Math.min(min, xArr[i] + yArr[i]); } StringBuilder sb = new StringBuilder(); sb.append(min).append("\n"); sb.append(0).append("\n"); for (int i = 0; i < n; i++) { sb.append(Math.max(min - yArr[i], 0)).append("\n"); } sb.append(min).append("\n"); System.out.print(sb); } }