#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) const int INF = 1<<30; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector x(n), y(n); REP (i, n) cin >> x[i]; REP (i, n) cin >> y[i]; int ret = INF; REP (i, n) ret = min(ret, x[i] + y[i]); cout << ret << endl; cout << 0 << endl; REP (i, n) cout << min(x[i], ret) << endl; cout << ret << endl; return 0; }