#include using namespace std; using ll = long long; int main() { int n; cin >> n; vector x(n), y(n); for (int i = 0; i < n; i++) { cin >> x.at(i); } for (int i = 0; i < n; i++) { cin >> y.at(i); } int min_d = 2 * (int)1e6; for (int i = 0; i < n; i++) { min_d = min(min_d, x.at(i) + y.at(i)); } cout << min_d << endl; cout << 0 << endl; for (int i = 0; i < n; i++) { cout << min(x.at(i), min_d) << endl; } cout << min_d << endl; }