#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 250005;
int a[N], b[N], n;
struct node {
int x, id;
bool operator < (const node & i) const {
return x > i.x;
}
};
priority_queue <node> q;
bool v[N];
int ans, sum = 0;
signed main() {
cin >> n;
for(int i = 1; i <= n; i++){
cin >> a[i];
}
for(int i = 1; i <= n; i++){
cin >> b[i];
}
for(int i = 1; i <= n; i++){
sum += a[i];
if(sum < b[i]){
if(!q.empty() && q.top().x > b[i]){
sum += q.top().x;
sum -= b[i];
v[q.top().id] = 0;
v[i] = 1;
q.pop();
q.push(node{b[i], i});
}
} else {
sum -= b[i];
ans++;
v[i] = 1;
q.push(node{b[i], i});
}
}
cout << ans << "\n";
for(int i = 1; i <= n; i++){
if(v[i]){
cout << i << ' ';
}
}
return 0;
}