#include using namespace std; typedef long long ll; int main() { int N; cin >> N; ll X[N], Y[N]; ll x_min = LLONG_MAX; for (int i = 0; i < N; i++) { cin >> X[i]; x_min = min(x_min, X[i]); } for (int i = 0; i < N; i++) { cin >> Y[i]; } ll d = LLONG_MAX; for (int i = 0; i < N; i++){ d = min(d, X[i] + Y[i]); } cout << d << "\n"; cout << "0\n"; for (int i = 0; i < N; i++) { if (x_min + Y[i] < d) { x_min = d - Y[i]; } cout << x_min << "\n"; } cout << d << "\n"; return 0; }