#include #include constexpr int INF = 1 << 30; void solve() { int n; std::cin >> n; std::vector xs(n), ys(n); for (auto& x : xs) std::cin >> x; for (auto& y : ys) std::cin >> y; int r = INF; for (int i = 0; i < n; ++i) { r = std::min(r, xs[i] + ys[i]); } std::cout << r << std::endl << 0 << std::endl; for (int i = 0; i < n; ++i) { std::cout << std::min(xs[i], r) << std::endl; } std::cout << r << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }