#include <iostream>
#include <set>
#include <utility>
#include <algorithm>
using namespace std;
#define mp make_pair
#define maxn 250010
int a[maxn], b[maxn];
int main() {
	int n;
	cin>>n;
	for (int i=0; i<n; i++) cin>>a[i];
	for (int i=0; i<n; i++) cin>>b[i];
	long long int curr= 0, r;
	set < pair <int, int> > s;
	pair <int, int> qq;
	for (int i=0; i<n; i++){
		curr+=a[i];
		if (curr>=b[i]){
			s.insert(mp(-b[i], i));
			curr-=b[i];
		}
		else{
			if (!s.empty()){
				qq= *s.begin();
				r= qq.first;
				r= -r;
				if (r<b[i]) continue;
				if (curr+r>=b[i]){
					s.erase(s.begin());
					s.insert(mp(-b[i], i));
					curr+=r-b[i];
				}
			}
 
		}
	}
	cout<<s.size()<<endl;
	set <int> res;
	for (set< pair <int, int> >::iterator it= s.begin(); it!=s.end(); it++){
		qq= *it;
		res.insert(qq.second);
	}
	for (set <int>::iterator it= res.begin(); it!=res.end(); it++){
		cout<<*it+1<<" ";
	}
	cout<<endl;
	return 0;
}