#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include using namespace std; int main() { int n; cin >> n; vectora(n), b(n); for (int i = 0; i < n; i++)cin >> a[i]; for (int i = 0; i < n; i++)cin >> b[i]; int x = 9999999; for (int i = 0; i < n; i++)x = min(x, a[i] + b[i]); cout << x << endl; cout << 0 << endl; for (int i = 0; i < n; i++) { if (a[i] >= x)cout << x << endl; else cout << a[i] << endl; } cout << x << endl; return 0; }