#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<pair<int, int>, int> > ab(n);
  for (int i = 0; i < n; i++) {
    cin >> ab[i].first.first;
    ab[i].second = i;
  }
  for (int i = 0; i < n; i++) cin >> ab[i].first.second;
  sort(ab.begin(), ab.end());
  reverse(ab.begin(), ab.end());
  vector<int> ans;
  vector<pair<pair<int, int>, int> > newab;
  stack<int> st;
  for (int i = n - 1; i >= 0; i--) {
    int a = ab[i].first.first, b = ab[i].first.second, ind = ab[i].second;
    if (st.empty()) {
      st.push(b);
      newab.push_back(ab[i]);
    } else {
      int top = st.top();
      if (b >= top) {
        ans.push_back(ind);
        newab.pop_back();
        st.pop();
      } else {
        st.push(b);
        newab.push_back(ab[i]);
      }
    }
  }
  ab = newab;
  for (int i = 0; i < ab.size(); i++) {
    int a = ab[i].first.first, b = ab[i].first.second, ind = ab[i].second;
    if (i % 2 == 0) ans.push_back(ind);
  }
  if (ab.size() > 0 && ab.size() % 2 == 0)
    ans.push_back(ab[ab.size() - 1].second);
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] + 1 << " ";
  printf("\n");
  return 0;
}
