#include #include #include #include #include using namespace std; using namespace atcoder; using ll = long long; using mint = modint998244353; #define rep(i, n) for (int i = 0; i< (int)(n); i++) int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n; cin >> n; vector> a(n); vector b(n-1), e(n); rep(i, n){ ll c; cin >> c; a[i] = {c, i+1}; e[i] = c; } rep(i, n-1)cin >> b[i]; sort(a.begin(), a.end()); sort(b.begin(), b.end()); vector> ans(n); vector c(n-1), d(n-1); rep(i, n-1){ c[i] = (i > 0) ? c[i-1] + abs(a[i].first - b[i]) : abs(a[i].first - b[i]); d[i] = (i > 0) ? d[i-1] + abs(a[i+1].first - b[i]) : abs(a[i+1].first - b[i]); } ans[0] = {d[n-2], a[0].second}; ans[n-1] = {c[n-2], a[n-1].second}; for(int i=1; i res; rep(i, t)res.insert(e[ans[i].second-1]); cout << res.size() << endl; for(auto p : res)cout << p << " "; cout << endl; return 0; }