#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define _overload(a, b, c, d, ...) d #define _rep1(X, A, Y) for (int (X) = (A);(X) <= (Y);++(X)) #define _rep2(X, Y) for (int (X) = 0;(X) < (Y);++(X)) #define rep(...) _overload(__VA_ARGS__, _rep1, _rep2)(__VA_ARGS__) #define rrep(X,Y) for (int (X) = Y-1;(X) >= 0;--(X)) #define all(X) (X).begin(),(X).end() #define len(X) ((int)(X).size()) #define mod(n, m) (((n)%(m)+(m))%m) #define fi first #define sc second using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair Pii; typedef pair Pll; const int INFINT = 1 << 30; // 1.07x10^ 9 const ll INFLL = 1LL << 60; // 1.15x10^18 const double EPS = 1e-10; const int MOD = 1000000007; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; const int MAX_N = 200000; int N; ll X[MAX_N+2]; ll Y[MAX_N+2]; int main() { cin >> N; rep(i, N) cin >> X[i]; rep(i, N) cin >> Y[i]; ll ans = INFLL; 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; return 0; }