#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector x(n); for (int i = 0; i < n; i++) { cin >> x[i]; } vector y(n); for (int i = 0; i < n; i++) { cin >> y[i]; } int pos = 1 << 30; for (int i = 0; i < n; i++) { pos = min(pos, x[i] + y[i]); } vector ans(n); for (int i = 0; i < n; i++) { ans[i] = max(0, pos - y[i]); } cout << pos << '\n'; cout << 0 << '\n'; for (int i = 0; i < n; i++) { cout << ans[i] << '\n'; } cout << pos << '\n'; return 0; }