#include #define rep(i,n) for(int i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector X(n); vector Y(n); vector res(n); rep(i, n) { cin >> X[i]; } rep(i, n) { cin >> Y[i]; res[i] = X[i] + Y[i]; } vector anstapi(n + 2); sort(all(res)); anstapi[0] = 0; for (int i = 1; i < n + 1; ++i) { anstapi[i] = min(res[0], X[i - 1]); } anstapi[n + 1] = res[0]; cout << anstapi[n + 1] << endl; rep(i, n + 2) { cout << anstapi[i] << endl; } return 0; }