#include using namespace std; int main(){ int n; cin >> n; vector x(n), y(n); for(int i = 0; i < n; i++) cin >> x[i]; for(int i = 0; i < n; i++) cin >> y[i]; int MIN = x[0] + y[0]; for(int i = 1; i < n; i++) MIN = min(MIN, x[i] + y[i]); cout << MIN << endl << 0 << endl; for(int i = 0; i < n; i++) cout << min(x[i], MIN - y[i]) << endl; cout << MIN << endl; }