#!/usr/bin/env python3 n = int(input()) x = list(map(int, input().split())) y = list(map(int, input().split())) m = min([a + b for a, b in zip(x, y)]) print(m) print(0) for i in range(n): print(min(x[i], m)) print(m)