#include using namespace std; const int INF = 100000000; int main(){ 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 ans = INF; for (int i = 0; i < N; i++){ ans = min(ans, X[i] + Y[i]); } cout << ans << endl; cout << 0 << endl; for (int i = 0; i < N; i++){ cout << min(X[i], ans) << endl; } cout << ans << endl; }