#include #include #include #include #include #include using namespace std; // 型名の短縮 using ll = long long; using pii = pair; using vi = vector; using vvi = vector; using vl = vector; using vvl = vector; template using priority_queue_rev = priority_queue, greater>; template bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; } template bool chmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; } #define all(a) a.begin(),a.end() #define rep(i, n) for(int i = 0, i##_end = int(n); i < i##_end; ++i) // 0 から n-1 まで昇順 #define repi(i, s, t) for(int i = int(s), i##_end = int(t); i <= i##_end; ++i) // s から t まで昇順 #define repir(i, s, t) for(int i = int(s), i##_end = int(t); i >= i##_end; --i) // s から t まで降順 #define repe(v, a) for(const auto& v : (a)) // a の全要素(変更不可能) #define repea(v, a) for(auto& v : (a)) // a の全要素(変更可能) #define repb(set, d) for(int set = 0; set < (1 << int(d)); ++set) // d ビット全探索(昇順) #define repp(a) sort(all(a)); for(bool a##_perm = true; a##_perm; a##_perm = next_permutation(all(a))) // a の順列全て(昇順) #define smod(n, m) ((((n) % (m)) + (m)) % (m)) // 非負mod #define uniq(a) {sort(all(a)); (a).erase(unique(all(a)), (a).end());} // 重複除去 // template inline T smod(T n, T m) { n %= m; if (n < 0) n += m; return n; } // 非負mod long long TEN(int x) { return x == 0 ? 1 : TEN(x - 1) * 10; }; int main(){ int n; cin >> n; vi A(n); vi B(n-1); rep(i,n){ cin>>A[i]; } rep(i,n-1)cin>>B[i]; sort(all(A)); sort(all(B)); ll cand=0; rep(i,n-1){ cand+=abs(A[i]-B[i]); } map mp; mp[cand].push_back(A[n-1]); rep(i,n-1){ int a = n-i-2; int b = n-i-1; cand += abs(A[b]-B[a])-abs(A[a]-B[a]); mp[cand].push_back(A[a]); } auto[u,V] = *mp.begin(); uniq(V); cout << V.size() << endl; repe(v,V){ cout << v << " "; } cout << endl; }