#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    int ful,dist;
}a[101000];

int sum[101000];
int res[101000];
int ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n,mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
            //cout<<sum[(i+1)%n]<<endl;
        }

        //cout<<endl;
        //while(1);

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
      //      cout<<mn<<endl;
        }

    //    while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];

            mn=min(sum[(i+1)%n],mn+sum[(i+1)%n]);
          //  mn=min(mn,now);

          //  cout<<lagbe<<" "<<mn<<" "<<now<<endl;
            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
          //      cout<<i<<endl;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);
            mn=min(sum[(i-1+n)%n],mn+sum[(i-1+n)%n]);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    int ful,dist;
}a[101000];

int sum[101000];
int res[101000];
int ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n,mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
            //cout<<sum[(i+1)%n]<<endl;
        }

        if(n==100 && a[i].ful==643232)
        {
            for(i=0;i<n;i++)
            {
                printf("%d ",a[i].ful);
                if(i%10==0) cout<<endl;
            }
            for(i=0;i<n;i++)
            {
                printf("%d ",a[i].dist);
                if(i%10==0) cout<<endl;
            }
        }

        //cout<<endl;
        //while(1);

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
      //      cout<<mn<<endl;
        }

    //    while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];

            mn=min(sum[(i+1)%n],mn+sum[(i+1)%n]);
          //  mn=min(mn,now);

          //  cout<<lagbe<<" "<<mn<<" "<<now<<endl;
            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
          //      cout<<i<<endl;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);
            mn=min(sum[(i-1+n)%n],mn+sum[(i-1+n)%n]);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    int ful,dist;
}a[101000];

int sum[101000];
int res[101000];
int ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);

    int i,n,mn,now,lagbe;
	while(scanf("%d",&n)==1)
	{

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
        }

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
            //cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];
            mn=min(mn,now);

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
            //    cout<<i;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

	}
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    long long ful,dist;
}a[101000];

long long sum[101000];
long long res[101000];
int ans[101000];

int main()
{
    freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n;
    long long mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
            //cout<<sum[(i+1)%n]<<endl;
        }

        //cout<<endl;
        //while(1);

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
      //      cout<<mn<<endl;
        }

    //    while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];

            mn=min(sum[(i+1)%n],mn+sum[(i+1)%n]);
          //  mn=min(mn,now);

         //   cout<<i<<" "<<lagbe<<" "<<mn<<" "<<now<<endl;
            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
            //    cout<<i<<endl;
            }
        }
     //   while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            //mn=min(mn,now);
            mn=min(sum[(i-1+n)%n],mn+sum[(i-1+n)%n]);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    long long ful,dist;
}a[101000];

long long sum[101000];
long long res[101000];
int ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n;
    long long mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
            //cout<<sum[(i+1)%n]<<endl;
        }

        if(n==100 && a[0].ful==643232)
        {

            for(i=81;i<n;i++)
            {
                printf("%d ",a[i].dist);
                if(i%10==0) cout<<endl;
            }
        }

        //cout<<endl;
        //while(1);

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
      //      cout<<mn<<endl;
        }

    //    while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];

            mn=min(sum[(i+1)%n],mn+sum[(i+1)%n]);
          //  mn=min(mn,now);

          //  cout<<lagbe<<" "<<mn<<" "<<now<<endl;
            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
          //      cout<<i<<endl;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);
            mn=min(sum[(i-1+n)%n],mn+sum[(i-1+n)%n]);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    long long ful,dist;
}a[101000];

long long sum[101000];
long long res[101000];
int ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n;
    long long mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
            //cout<<sum[(i+1)%n]<<endl;
        }

        if(n==100 && a[0].ful==643232)
        {
            for(i=91;i<n;i++)
            {
                printf("%d ",a[i].ful);
                if(i%10==0) cout<<endl;
            }

            cout<<endl;
            for(i=0;i<n;i++)
            {
                printf("%d ",a[i].dist);
                if(i%10==0) cout<<endl;
            }
        }

        //cout<<endl;
        //while(1);

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
      //      cout<<mn<<endl;
        }

    //    while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];

            mn=min(sum[(i+1)%n],mn+sum[(i+1)%n]);
          //  mn=min(mn,now);

          //  cout<<lagbe<<" "<<mn<<" "<<now<<endl;
            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
          //      cout<<i<<endl;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);
            mn=min(sum[(i-1+n)%n],mn+sum[(i-1+n)%n]);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    int ful,dist;
}a[101000];

int sum[101000];
int res[101000];
int ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n,mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
            //cout<<sum[(i+1)%n]<<endl;
        }

        if(n==100 && a[0].ful==643232)
        {
            for(i=0;i<n;i++)
            {
                printf("%d ",a[i].ful);
                if(i%10==0) cout<<endl;
            }
            for(i=0;i<n;i++)
            {
                printf("%d ",a[i].dist);
                if(i%10==0) cout<<endl;
            }
        }

        //cout<<endl;
        //while(1);

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
      //      cout<<mn<<endl;
        }

    //    while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];

            mn=min(sum[(i+1)%n],mn+sum[(i+1)%n]);
          //  mn=min(mn,now);

          //  cout<<lagbe<<" "<<mn<<" "<<now<<endl;
            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
          //      cout<<i<<endl;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);
            mn=min(sum[(i-1+n)%n],mn+sum[(i-1+n)%n]);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    long long ful,dist;
}a[101000];

long long sum[101000];
long long res[101000];
long long ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n;
    long long mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
            //cout<<sum[(i+1)%n]<<endl;
        }

        /*if(n==100 && a[0].ful==643232)
        {
            for(i=0;i<n;i++)
            {
                printf("%d ",a[i].ful);
                if(i%10==0) cout<<endl;
            }
            for(i=0;i<n;i++)
            {
                printf("%d ",a[i].dist);
                if(i%10==0) cout<<endl;
            }
        }*/

        //cout<<endl;
        //while(1);

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
      //      cout<<mn<<endl;
        }

    //    while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];

            mn=min(sum[(i+1)%n],mn+sum[(i+1)%n]);
          //  mn=min(mn,now);

          //  cout<<lagbe<<" "<<mn<<" "<<now<<endl;
            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
          //      cout<<i<<endl;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);
            mn=min(sum[(i-1+n)%n],mn+sum[(i-1+n)%n]);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    long long ful,dist;
}a[101000];

long long sum[101000];
long long res[101000];
int ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n;
    long long mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
            //cout<<sum[(i+1)%n]<<endl;
        }

        if(n==100 && a[0].ful==643232)
        {
            for(i=31;i<n;i++)
            {
                printf("%d ",a[i].ful);
                if(i%10==0) cout<<endl;
            }
            for(i=0;i<n;i++)
            {
                printf("%d ",a[i].dist);
                if(i%10==0) cout<<endl;
            }
        }

        //cout<<endl;
        //while(1);

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
      //      cout<<mn<<endl;
        }

    //    while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];

            mn=min(sum[(i+1)%n],mn+sum[(i+1)%n]);
          //  mn=min(mn,now);

          //  cout<<lagbe<<" "<<mn<<" "<<now<<endl;
            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
          //      cout<<i<<endl;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);
            mn=min(sum[(i-1+n)%n],mn+sum[(i-1+n)%n]);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    long long ful,dist;
}a[101000];

long long sum[101000];
long long res[101000];
int ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n;
    long long mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%I64d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[(i+1)%n]=a[i].ful-a[i].dist;
            //cout<<sum[(i+1)%n]<<endl;
        }

        if(n==100 && a[0].ful==643232)
        {

            cout<<endl;
            for(i=21;i<n;i++)
            {
                printf("%d ",a[i].dist);
                if(i%10==0) cout<<endl;
            }
        }

        //cout<<endl;
        //while(1);

        mn=0;
        now=0;

        for(i=0;i<n;i++)
        {
            now+=sum[(i+1)%n];
            mn=min(mn,now);
            res[(i+1)%n]=mn;
      //      cout<<mn<<endl;
        }

    //    while(1);

        now=0;
        mn=0;

        if(res[0]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i];
            now+=sum[(i+1)%n];

            mn=min(sum[(i+1)%n],mn+sum[(i+1)%n]);
          //  mn=min(mn,now);

          //  cout<<lagbe<<" "<<mn<<" "<<now<<endl;
            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
          //      cout<<i<<endl;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        for(i=n-2;i>=-1;i--)
        {
            now+=sum[(i+n)%n];
            mn=min(mn,now);
            res[(i+n)%n]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[n-1]>=0) ans[n-1]=1;
        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);
            mn=min(sum[(i-1+n)%n],mn+sum[(i-1+n)%n]);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<ctime>
#include<assert.h>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

#define MAX(a,b) ((a)>(b) ? (a) : (b))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define EPS 1e-9

struct pl
{
    int ful,dist;
}a[101000];

int sum[101000];
int res[101000];
int ans[101000];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int i,n,mn,now,lagbe;
    while(scanf("%d",&n)==1)
    {

        memset(ans,0,sizeof(ans));
        for(i=0;i<n;i++)
            scanf("%d",&a[i].ful);
        for(i=0;i<n;i++)
            scanf("%d",&a[i].dist);
        for(i=0;i<n;i++)
        {
            sum[i+1]=a[i].ful-a[i].dist;
         //   cout<<sum[i]<<endl;
        }

        //while(1);
        mn=0;
        now=0;
        res[0]=0;
        for(i=0;i<n-1;i++)
        {
            now+=sum[i+1];
            mn=min(mn,now);
            res[i+1]=mn;
            //cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        if(res[n-1]>=0) ans[0]=1;
        //if start from i
        for(i=n-1;i>=1;i--)
        {
            lagbe=res[i-1];
            now+=sum[i+1];
            mn=min(mn,now);

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
            //    cout<<i;
            }
        }
       // while(1);

        //sum[n-1]=0;
        for(i=n-1;i>=0;i--)
        {
            sum[i]=a[(i+1)%n].ful-a[i].dist;

          //  cout<<i<<" "<<sum[i]<<endl;
        }
        //while(1);

        //while(1);

        mn=0;
        now=0;

        //cout<<n;

        res[n-1]=0;
        for(i=n-2;i>=0;i--)
        {
            now+=sum[i];
            mn=min(mn,now);
            res[i]=mn;
         //   cout<<mn<<endl;
        }

        //while(1);

        now=0;
        mn=0;

        //cout<<res[0]<<endl;

        //while(1);

        if(res[0]>=0) ans[n-1]=1;
        //if start from i
        //cout<<ans[n-1];

        //while(1);

        for(i=0;i<=(n-2);i++)
        {
            lagbe=res[i+1];
            now+=sum[(i-1+n)%n];

           // cout<<sum[(i-1+n)%n];;

           // while(1);
            mn=min(mn,now);

           // cout<<lagbe<<" "<<mn<<endl;

            if(mn<0)
            {
                continue;
            }
            else if((lagbe+now)>=0)
            {
                ans[i]=1;
        //        cout<<i<<"ok"<<endl;
            }
        }

   //     while(1);

        //0 theke start kore i porjonto jaite at least res[i] extra nie aste hobe

        int cnt=0;
        vector<int> v;

        for(i=0;i<n;i++)
        {
            if(ans[i]==1)
            {
                cnt++;
                v.push_back(i+1);
            }
        }

        printf("%d\n",cnt);

        for(i=0;i<v.size();i++)
        {
            if(i) printf(" ");
            printf("%d",v[i]);
        }
        printf("\n");

    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>

using namespace std;

deque<int> deq;
vector<int> Ans;

int N;
int A[300000], B[300000];

bool OK[300000];
int pre[300000];
int post[300000];

int main()
{
    scanf("%d", &N);

    for(int Ni = 1; Ni <= N; Ni++)
        scanf("%d", &A[Ni]);

    for(int Ni = 1; Ni <= N; Ni++)
        scanf("%d", &B[Ni]);

    for(int Ni = N+1; Ni <= N*2; Ni++)
        A[Ni] = A[Ni-N], B[Ni] = B[Ni-N];

    pre[0] = 0;
    for(int Ni = 1; Ni <= N*2; Ni++)
        pre[Ni] = pre[Ni-1]+A[Ni]-B[Ni];

    for(int Ni = 1; Ni <= N; Ni++)
    {
        while( !deq.empty() && pre[deq.back() ] >= pre[Ni] ) deq.pop_back();
        deq.push_back(Ni);
    }

    for(int Ni = N+1; Ni <= N*2; Ni++)
    {
        while( !deq.empty() && Ni-deq.front() >= N ) deq.pop_front();

        while( !deq.empty() && pre[deq.back() ] >= pre[Ni] ) deq.pop_back();
        deq.push_back(Ni);

        if( pre[deq.front()]-pre[Ni-N] >= 0 ) OK[(Ni-N)%N+1] = true;
    }

    B[0] = B[N*2];

    post[N*2+1] = 0;
    for(int Ni = N*2; Ni >= 1; Ni--)
        post[Ni] = post[Ni+1]+A[Ni]-B[Ni-1];

    while( !deq.empty() ) deq.pop_back();

    for(int Ni = N*2; Ni >= N+1; Ni--)
    {
        while( !deq.empty() && post[deq.back() ] >= post[Ni] ) deq.pop_back();
        deq.push_back(Ni);
    }

    for(int Ni = N; Ni >= 1; Ni--)
    {
        while( !deq.empty() && deq.front()-Ni >= N ) deq.pop_front();

        while( !deq.empty() && post[deq.back() ] >= post[Ni] ) deq.pop_back();
        deq.push_back(Ni);

        if( post[deq.front()]-post[Ni+N] >= 0 ) OK[(Ni+N-2)%N+1 ] = true;
    }

    for(int Ni = 1; Ni <= N; Ni++)
        if( OK[Ni] ) Ans.push_back(Ni);

    printf("%lu\n", Ans.size());

    for(int i = 0; i < Ans.size(); i++)
    {
        printf("%d", Ans[i]);

        if( i+1 == Ans.size() ) puts("");
        else printf(" ");
    }
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>

using namespace std;

deque<int> deq;
vector<int> Ans;

int N;
int A[300000], B[300000];

bool OK[300000];
int pre[300000];
int post[300000];

int main()
{
    scanf("%d", &N);

    for(int Ni = 1; Ni <= N; Ni++)
        scanf("%d", &A[Ni]);

    for(int Ni = 1; Ni <= N; Ni++)
        scanf("%d", &B[Ni]);

    for(int Ni = N+1; Ni <= N*2; Ni++)
        A[Ni] = A[Ni-N], B[Ni] = B[Ni-N];

    pre[0] = 0;
    for(int Ni = 1; Ni <= N*2; Ni++)
        pre[Ni] = pre[Ni]+A[Ni]-B[Ni];

    for(int Ni = 1; Ni <= N; Ni++)
    {
        while( !deq.empty() && pre[deq.back() ] >= pre[Ni] ) deq.pop_back();
        deq.push_back(Ni);
    }

    for(int Ni = N+1; Ni <= N*2; Ni++)
    {
        while( !deq.empty() && Ni-deq.front() >= N ) deq.pop_front();

        while( !deq.empty() && pre[deq.back() ] >= pre[Ni] ) deq.pop_back();
        deq.push_back(Ni);

        if( pre[deq.front()]-pre[Ni-N] >= 0 ) OK[(Ni-N)%N+1] = true;
    }

    B[0] = B[N*2];

    post[N*2+1] = 0;
    for(int Ni = N*2; Ni >= 1; Ni--)
        post[Ni] = post[Ni+1]+A[Ni]-B[Ni-1];

    while( !deq.empty() ) deq.pop_back();

    for(int Ni = N*2; Ni >= N+1; Ni--)
    {
        while( !deq.empty() && post[deq.back() ] >= post[Ni] ) deq.pop_back();
        deq.push_back(Ni);
    }

    for(int Ni = N; Ni >= 1; Ni--)
    {
        while( !deq.empty() && deq.front()-Ni >= N ) deq.pop_front();

        while( !deq.empty() && post[deq.back() ] >= post[Ni] ) deq.pop_back();
        deq.push_back(Ni);

        if( post[deq.front()]-post[Ni+N] >= 0 ) OK[(Ni+N-2)%N+1 ] = true;
    }

    for(int Ni = 1; Ni <= N; Ni++)
        if( OK[Ni] ) Ans.push_back(Ni);

    printf("%lu\n", Ans.size());

    for(int i = 0; i < Ans.size(); i++)
    {
        printf("%d", Ans[i]);

        if( i+1 == Ans.size() ) puts("");
        else printf(" ");
    }
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

int n;
vector <int> a, b;

void rev(vector <int> & a, vector <int> & b)
{
    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end() - 1);
}

vector <char> solve(const vector <int> & a, const vector <int> & b)
{
    vector <int> d = a;
    for (int i = 0; i < n; ++i)
        d[i] -= b[i];
    d.insert(d.end(), d.begin(), d.end());
    for (int i = 1; i < 2 * n; ++i)
        d[i] += d[i - 1];

    vector <int> ll(n), rr(n + 1);
    ll[n - 1] = d[n - 1];
    for (int i = n - 2; i >= 0; --i)
        ll[i] = min(ll[i + 1], d[i]);
    rr[0] = ll[0], rr[1] = d[n];
    for (int i = 2; i <= n; ++i)
        rr[i] = min(rr[i - 1], d[n + i - 1]);

    vector <char> ret(n, false);
    int sum = 0;
    for (int i = 0; i < n; ++i)
    {
        ret[i] = (min(ll[i], rr[i]) >= sum);
        sum = d[i];
    }

    return ret;
}

int main()
{
    scanf("%d", &n);
    a.resize(n), b.resize(n);
    for (int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    for (int i = 0; i < n; ++i)
        scanf("%d", &b[i]);

    vector <char> can1 = solve(a, b);
    rev(a, b);
    vector <char> can2 = solve(a, b);
    reverse(can2.begin(), can2.end());

    int k = 0;
    for (int i = 0; i < n; ++i)
        k += (can1[i] || can2[i]);

    printf("%d\n", k);
    for (int i = 0; i < n; ++i)
        if (can1[i] || can2[i])
            printf("%d ", i + 1);
    if (k) putchar('\n');

    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

int n;
vector <int> a, b;

void rev(vector <int> & a, vector <int> & b)
{
    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end() - 1);
}

vector <char> solve(const vector <int> & a, const vector <int> & b)
{
    vector <int> d = a;
    for (int i = 0; i < n; ++i)
        d[i] -= b[i];
    d.insert(d.end(), d.begin(), d.end());
    for (int i = 1; i < 2 * n; ++i)
        d[i] += d[i - 1];

    vector <int> ll(n), rr(n + 1);
    ll[n - 1] = d[n - 1];
    for (int i = n - 2; i >= 0; --i)
        ll[i] = min(ll[i + 1], d[i]);
    rr[0] = ll[0], rr[1] = d[n];
    for (int i = 2; i <= n; ++i)
        rr[i] = min(rr[i - 2], d[n + i - 1]);

    vector <char> ret(n, false);
    int sum = 0;
    for (int i = 0; i < n; ++i)
    {
        ret[i] = (min(ll[i], rr[i]) >= sum);
        sum = d[i];
    }

    return ret;
}

int main()
{
    scanf("%d", &n);
    a.resize(n), b.resize(n);
    for (int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    for (int i = 0; i < n; ++i)
        scanf("%d", &b[i]);

    vector <char> can1 = solve(a, b);
    rev(a, b);
    vector <char> can2 = solve(a, b);
    reverse(can2.begin(), can2.end());

    int k = 0;
    for (int i = 0; i < n; ++i)
        k += (can1[i] || can2[i]);

    printf("%d\n", k);
    for (int i = 0; i < n; ++i)
        if (can1[i] || can2[i])
            printf("%d ", i + 1);
    if (k) putchar('\n');

    return 0;
}


//In the name Of Allah
//
//
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int MN=1000*100+1000;
bool mark[MN];
int a[MN];
int b[MN];
int mx=-1,p=-1;
vector <int> sol;
int n;
int dis(int a,int mb)
{
	if (a>mb)
		return dis(mb,a);
	if (a==0)
	{
		if (mb==1)
			return b[0];
		return b[n-1];
	}
	return b[a];
}
void add(int a)
{
	if (mark[a])
		return ;
	mark[a]=1;
	sol.push_back(a);
}
int findp1()
{
	int last=0;
	int now=a[0];
	for (int i=1;i<n;i++)
	{
		if (now<b[i-1])
		{
			now=a[i];
			last=i;
			continue;
		}
		now-=b[i-1];
		now+=a[i];
	}
	return last;
}
int findp2()
{
	int last=n-1;
	int now=a[n-1];
	for (int i=n-2;i>=0;i--)
	{
		if (now<b[i])
		{
			now=a[i];
			last=i;
			continue;
		}
		now-=b[i];
		now+=a[i];
	}
	return last;
}
int main()
{
	scanf("%d",&n);
	for (int i=0;i<n;i++)
		scanf("%d",&a[i]);
	for (int i=0;i<n;i++)
		scanf("%d",&b[i]);
	int need=0;
	p=findp2();
	for (int i=(p+1)%n;i!=p;i=(i+1)%n)
	{
		int last=(i-1);
		if (last<0)
			last+=n;
		int tmp=need+dis(i,last)-a[i];
		if (tmp<0)
			tmp=0;
		if (tmp==0)
			add(i);
		need=tmp;
	}
	need=0;
	p=findp1();
	for (int i=(((p-1)%n)+n)%n;i!=p;i=(((i-1)%n)+n)%n)
	{
		int last=(i+1)%n;
		int tmp=need+dis(i,last)-a[i];
		if (tmp<0)
			tmp=0;
		if (tmp==0)
			add(i);
		need=tmp;
	}
	sort(sol.begin(),sol.end());
	printf("%d\n",sol.size());
	for (int i=0;i<sol.size();i++)
		printf("%d ",sol[i]+1);
	printf("\n");
	return 0;
}


//In the name Of Allah
//
//
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int MN=1000*100+1000;
bool mark[MN];
int a[MN];
int b[MN];
int mx=-1,p=-1;
vector <int> sol;
int n;
int dis(int a,int mb)
{
	if (a>mb)
		return dis(mb,a);
	if (a==0)
	{
		if (mb==1)
			return b[0];
		return b[n-1];
	}
	return b[a];
}
void add(int a)
{
	if (mark[a])
		return ;
	mark[a]=1;
	sol.push_back(a);
}
int findp1()
{
	int last=0;
	int now=a[0];
	for (int i=1;i<n;i++)
	{
		if (now<b[i-1])
		{
			now=a[i];
			last=i;
			continue;
		}
		now-=b[i-1];
		now+=a[i];
	}
	return last;
}
int findp2()
{
	int last=n-1;
	int now=a[n-1];
	for (int i=n-2;i>=0;i--)
	{
		if (now<b[i])
		{
			now=a[i];
			last=i;
			continue;
		}
		now-=b[i];
		now+=a[i];
	}
	return last;
}
int main()
{
	scanf("%d",&n);
	for (int i=0;i<n;i++)
		scanf("%d",&a[i]);
	for (int i=0;i<n;i++)
		scanf("%d",&b[i]);
	int need=0;
	p=findp2();
	add(p);
	for (int i=(p+1)%n;i!=p;i=(i+1)%n)
	{
		int last=(i-1);
		if (last<0)
			last+=n;
		int tmp=need+dis(i,last)-a[i];
		if (tmp<0)
			tmp=0;
		if (tmp==0)
			add(i);
		need=tmp;
	}
	need=0;
	p=findp1();
	add(p);
	for (int i=(((p-1)%n)+n)%n;i!=p;i=(((i-1)%n)+n)%n)
	{
		int last=(i+1)%n;
		int tmp=need+dis(i,last)-a[i];
		if (tmp<0)
			tmp=0;
		if (tmp==0)
			add(i);
		need=tmp;
	}
	sort(sol.begin(),sol.end());
	printf("%d\n",sol.size());
	for (int i=0;i<sol.size();i++)
		printf("%d ",sol[i]+1);
	printf("\n");
	return 0;
}


//In the name Of Allah
//
//
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
const int MN=1000*100+1000;
#define show(x) cerr<<((#x))<<" = "<<((x))<<endl
bool mark[MN];
int a[MN];
int b[MN];
int mx=-1,p=-1;
vector <int> sol;
int n;
int dis(int a,int mb)
{
	if (a>mb)
		return dis(mb,a);
	if (a==0)
	{
		if (mb==1)
			return b[0];
		return b[n-1];
	}
	return b[a];
}
void add(int a)
{
	if (mark[a])
		return ;
	mark[a]=1;
	sol.push_back(a);
}
int findp1()
{
	int last=0;
	int now=a[0];
	for (int i=1;i<n;i++)
	{
		if (now<b[i-1])
		{
			now=a[i];
			last=i;
			continue;
		}
		now-=b[i-1];
		now+=a[i];
	}
	return last;
}
int findp2()
{
	int last=n-1;
	int now=a[n-1];
	for (int i=n-2;i>=0;i--)
	{
		if (now<b[i])
		{
			now=a[i];
			last=i;
			continue;
		}
		now-=b[i];
		now+=a[i];
	}
	return last;
}
int main()
{
	scanf("%d",&n);
	for (int i=0;i<n;i++)
		scanf("%d",&a[i]);
	for (int i=0;i<n;i++)
		scanf("%d",&b[i]);
	int need=0;
	p=findp2();
	show(p);
	add(p);
	for (int i=(p+1)%n;i!=p;i=(i+1)%n)
	{
		int last=(i-1);
		if (last<0)
			last+=n;
		int tmp=need+dis(i,last)-a[i];
		cerr<<"need["<<i<<"] = "<<tmp<<endl;
		if (tmp<0)
			tmp=0;
		if (tmp==0)
			add(i);
		need=tmp;
	}
	need=0;
	p=findp1();
	show(p);
	add(p);
	for (int i=(((p-1)%n)+n)%n;i!=p;i=(((i-1)%n)+n)%n)
	{
		int last=(i+1)%n;
		int tmp=need+dis(i,last)-a[i];
		cerr<<"need["<<i<<"] = "<<tmp<<endl;
		if (tmp<0)
			tmp=0;
		if (tmp==0)
			add(i);
		need=tmp;
	}
	sort(sol.begin(),sol.end());
	printf("%d\n",sol.size());
	for (int i=0;i<sol.size();i++)
		printf("%d ",sol[i]+1);
	printf("\n");
	return 0;
}


//Lukasz Grzadko
#include <iostream>
#include <cstring>
#include <cstdio>

using namespace std;

int a[100010], b[100010], sol[100010];
int c[100010], d[100010];
long long A[100010], m[100010], M[100010];
  int n;
void solution(int *a, int *b, int kier) {
  long long sa = 0, sb = 0;
  for (int i = 1; i <= n; i++) {
    sa += a[i], sb += b[i];
    A[i] = sa - sb;
  }

  m[0] = 1000000000000000LL;
  M[n + 1] = 1000000000000000LL;

  for (int i = 1; i <= n; i++) {
    m[i] = min(A[i], m[i - 1]);
//    printf("%d %d ", A[i], m[i]);
  }
//  printf("\n");

  for (int i = n; i >= 1; i--) {
    M[i] = min(A[i], M[i + 1]);
  }

  long long mm = 0; //bylo zle, bo na odwrot tzn. mm = m[1]...
  long long MM = M[1];//...oraz MM = 0
  if (mm >= 0 && MM >= 0) {
    if (!kier)
    sol[1] = 1;
    else sol[n] = 1;
  }

  for (int i = 2; i <= n; i++) {
    MM = M[i] - A[i - 1];
    mm = m[i - 1] - (A[i - 1] - A[n]);
    if (mm >= 0 && MM >= 0) {
      if (!kier)
      sol[i] = 1;
      else sol[n - i + 1] = 1;
    }
  }
}

int main() {
  memset(sol,0,sizeof(sol));
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i + 1);
    c[n - i] = a[i + 1];
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", b + i + 1);
  }

  for (int i = 1; i <= n; i++) {
    d[i] = b[n - i];
  }
  d[n] = b[n];
/*  for (int i = 1; i <= n; i++) {
    printf("%d ", c[i]);
  }
  printf("\n");
  for (int i = 1; i <= n; i++) {
    printf("%d ", d[i]);
  }
  printf("\n");  */

  solution(a, b, 0);
  solution(c, d, 1);

  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (sol[i]) cnt++;
    //printf("%d ", sol[i]);
  }
  printf("%d\n", cnt);
  int k = 1;
  for (int i = 1; i <= n; i++) {
    if (sol[i]) {
      if (k < cnt) {
        printf("%d ", i);
        k++;
      } else {
        printf("%d\n",i);
      }

    }
  }

  return 0;
}


/*
Crave
Consume
Possess
Discard

Deceive
Derange
Destruct
Repeat

In modern ivory towers
Existence is dehumanized
When complacency calculates
Exploitation becomes relative

Forging the blade for your decapitation
Orchestrating downfall
Preaching excessiveness

The downside of contentment
The vile philosophy
Of a system poised to fail itself

All hail the meltdown
Unite under the banner of gluttony
Bear witness to the great experiment
Of poverty through profit

A culture of avarice
Detached from reason

So scream the primal scream of greed
And pound the drums of ruin
*/

//#pragma comment(linker, "/STACK:16777216")
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <ctime>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash

#define eps 1e-11
//#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 256
#define right adsgasgadsg
#define free adsgasdg

using namespace std;

long long n,a[1<<20],b[1<<20],s,mn,ans[1<<20];
vector<long long> v;

int main(){
//freopen("lesson.in","r",stdin);
//freopen("lesson.out","w",stdout);
//freopen("C:/input.txt","r",stdin);
//freopen("C:/output.txt","w",stdout);
ios_base::sync_with_stdio(0);
//cin.tie(0);

cin>>n;
for (int i=1;i<=n;i++)
 cin>>a[i];
for (int i=1;i<=n;i++)
 cin>>b[i];

s=0;
mn=1e18;

for (int i=1;i<=n;i++)
{
 s+=a[i]-b[i];
 if (s<mn)mn=s;
}

for (int i=1;i<=n;i++)
{
    if (mn>=0) ans[i]=1;
    mn+=b[i]-a[i];
}

s=0;
mn=1e18;

for (int i=1;i<=n;i++)
{
 if (i<n-i+1)
  swap(a[i],a[n-i+1]);
 if (i<n-i)
  swap(b[i],b[n-i]);
}

for (int i=1;i<=n;i++)
{
 s+=a[i]-b[i];
 if (s<mn)mn=s;
}

for (int i=1;i<=n;i++)
{
    if (mn>=0) ans[n-i+1]=1;
    mn+=b[i]-a[i];
}

for (int i=1;i<=n;i++)
 if (ans[i])
  v.push_back(i);

cout<<v.size()<<endl;
for (int i=0;i<v.size();i++)
{
    if (i)cout<<" ";
    cout<<v[i];
}
cout<<endl;

cin.get();cin.get();
return 0;}


#pragma comment(linker, "/STACK:136777216")

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <complex>

using namespace std;

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define forn(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define each(it, v) for (__typeof(v) it = v.begin(); it != v.end(); it++)
#define mp make_pair
#define pb push_back
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define sqr(x) (x) * (x)
#define dbg(v) rep(i, sz(v)) cout << v[i] << " "; cout << "\n"
#define dbg2(n) cout << #n << ": " << n << "\n"
#define subsub(n) rep(i, 1 << n) for (int j = i; j > 0; j = (j - 1) & i)
#define fi first
#define se second

typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <vi> vvi;

int bits (int x) { return x == 0? 0: 1 + bits(x & (x - 1)); }

const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 1000000000;

typedef complex < double > base;
typedef vector < base > vb;

string nextString(){
        char buf[300000];
        scanf("%s", buf);
        return buf;
}

vi a, b;

int p, cur, n;

vi res;

void go(int i, int l, int need){
	int ind = (l == 1) ? p : ((p - 1) + n) % n;
	while(cur + a[p] >= b[ind]){
		cur += (a[p] - b[ind]);
		p += l;
		p = (p + n) % n;
		ind = (l == 1) ? p : ((p - 1) + n) % n;
		if(p == need || res[p] == l){
			p = need;
			return;
		}
	}
}

int main(){
        #ifdef _DEBUG
                #define FILENAME "test"
                freopen (FILENAME".in", "rt", stdin);
				freopen (FILENAME".out", "wt", stdout);
        #endif
        //ios_base::sync_with_stdio(0);
		cin >> n;
		res.resize(n);
		rep(i, n)
			res[i] = 0;
		a.resize(n), b.resize(n);
		rep(i, n)
			scanf("%d", &a[i]);
		rep(i, n)
			scanf("%d", &b[i]);
		p = 0, cur = 0;
		go(0, 1, 0);
		vi ans;
		if(p == 0 && a[0] >= b[0]){
			res[0] = 1;
		}
		for(int i = n - 1; i > 0; i--){
			if(a[i] < b[i]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i]);
				go(p, 1, i);
			}
			if(p == i)
				res[i] = 1;
		}
		p = 0, cur = 0;
		go(0, -1, 0);
		if(p == 0 && a[0] >= b[n - 1]){
			res[0] = -1;
		}
		forn(i, 1, n){
			if(a[i] < b[i - 1]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i - 1]);
				go(p, -1, i);
			}
			if(p == i)
				res[i] = -1;
		}
		rep(i, n)
			if(res[i])
				ans.pb(i);
		cout << sz(ans) << "\n";
		rep(i, sz(ans))
			printf("%i ", ans[i] + 1);// << " ";
		return 0;
}


#pragma comment(linker, "/STACK:136777216")

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <complex>

using namespace std;

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define forn(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define each(it, v) for (__typeof(v) it = v.begin(); it != v.end(); it++)
#define mp make_pair
#define pb push_back
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define sqr(x) (x) * (x)
#define dbg(v) rep(i, sz(v)) cout << v[i] << " "; cout << "\n"
#define dbg2(n) cout << #n << ": " << n << "\n"
#define subsub(n) rep(i, 1 << n) for (int j = i; j > 0; j = (j - 1) & i)
#define fi first
#define se second

typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <vi> vvi;

int bits (int x) { return x == 0? 0: 1 + bits(x & (x - 1)); }

const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 1000000000;

typedef complex < double > base;
typedef vector < base > vb;

string nextString(){
        char buf[300000];
        scanf("%s", buf);
        return buf;
}

vi a, b;

int p, cur, n;

vi res;

void go(int i, int l, int need){
	int ind = (l == 1) ? p : ((p - 1) + n) % n;
	while(cur + a[p] >= b[ind]){
		cur += (a[p] - b[ind]);
		p += l;
		p = (p + n) % n;
		ind = (l == 1) ? p : ((p - 1) + n) % n;
		if(p == need || res[p] == l)
			return;
	}
}

int main(){
        #ifdef _DEBUG
                #define FILENAME "test"
                freopen (FILENAME".in", "rt", stdin);
				freopen (FILENAME".out", "wt", stdout);
        #endif
        //ios_base::sync_with_stdio(0);
		cin >> n;
		res.resize(n);
		rep(i, n)
			res[i] = 0;
		a.resize(n), b.resize(n);
		rep(i, n)
			scanf("%d", &a[i]);
		rep(i, n)
			scanf("%d", &b[i]);
		p = 0, cur = 0;
		go(0, 1, 0);
		vi ans;
		if(p == 0 && a[0] >= b[0]){
			res[0] = 1;
		}
		for(int i = n - 1; i > 0; i--){
			if(a[i] < b[i]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i]);
				go(p, 1, i);
			}
			if(p == i)
				res[i] = 1;
		}
		p = 0, cur = 0;
		go(0, -1, 0);
		if(p == 0 && a[0] >= b[n - 1]){
			res[0] = -1;
		}
		forn(i, 1, n){
			if(a[i] < b[i - 1]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i - 1]);
				go(p, -1, i);
			}
			if(p == i)
				res[i] = -1;
		}
		rep(i, n)
			if(res[i])
				ans.pb(i);
		cout << sz(ans) << "\n";
		rep(i, sz(ans))
			printf("%i ", ans[i] + 1);// << " ";
		return 0;
}


#pragma comment(linker, "/STACK:136777216")

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <complex>

using namespace std;

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define forn(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define each(it, v) for (__typeof(v) it = v.begin(); it != v.end(); it++)
#define mp make_pair
#define pb push_back
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define sqr(x) (x) * (x)
#define dbg(v) rep(i, sz(v)) cout << v[i] << " "; cout << "\n"
#define dbg2(n) cout << #n << ": " << n << "\n"
#define subsub(n) rep(i, 1 << n) for (int j = i; j > 0; j = (j - 1) & i)
#define fi first
#define se second

typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <vi> vvi;

int bits (int x) { return x == 0? 0: 1 + bits(x & (x - 1)); }

const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 1000000000;

typedef complex < double > base;
typedef vector < base > vb;

string nextString(){
        char buf[300000];
        scanf("%s", buf);
        return buf;
}

vi a, b;

int pt, cur, n;

void go(int i, int l){
	while(cur + a[pt] > b[pt]){
		pt += l;
		pt %= n;
		cur += (a[pt] - b[pt]);
	}
}

int main(){
        #ifdef _DEBUG
                #define FILENAME "test"
                freopen (FILENAME".in", "rt", stdin);
        freopen (FILENAME".out", "wt", stdout);
        #endif
        ios_base::sync_with_stdio(0);
		cin >> n;
		a.resize(n), b.resize(n);
		rep(i, n)
			cin >> a[i];
		rep(i, n)
			cin >> b[i];
		pt = 0, cur = 0;
		go(0, 1);
		vi ans;
		if(pt == 0){
			ans.pb(0);
		}

		for(int i = n - 1; i > 0; i--){
			if(a[i] < b[i])
				pt = i;
			else{
				cur += (a[i] - b[i]);
				go(pt, 1);
			}
			if(pt == i)
				ans.pb(i);
		}
		pt = 0, cur = 0;
		go(0, 1);
		if(pt == 0){
			ans.pb(0);
		}
		forn(i, 1, n){
			if(a[i] < b[i])
				pt = i;
			else{
				cur += (a[i] - b[i]);
				go(pt, -1);
			}
			if(pt == i)
				ans.pb(i);
		}
		vector < bool > res(n, false);
		rep(i, sz(ans))
			res[ans[i]] = true;
		ans.clear();
		rep(i, n)
			if(res[i])
				ans.pb(i);
		cout << sz(ans) << "\n";
		rep(i, sz(ans))
			cout << ans[i] << " ";
		return 0;
}


#pragma comment(linker, "/STACK:136777216")

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <complex>

using namespace std;

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define forn(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define each(it, v) for (__typeof(v) it = v.begin(); it != v.end(); it++)
#define mp make_pair
#define pb push_back
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define sqr(x) (x) * (x)
#define dbg(v) rep(i, sz(v)) cout << v[i] << " "; cout << "\n"
#define dbg2(n) cout << #n << ": " << n << "\n"
#define subsub(n) rep(i, 1 << n) for (int j = i; j > 0; j = (j - 1) & i)
#define fi first
#define se second

typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <vi> vvi;

int bits (int x) { return x == 0? 0: 1 + bits(x & (x - 1)); }

const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 1000000000;

typedef complex < double > base;
typedef vector < base > vb;

string nextString(){
        char buf[300000];
        scanf("%s", buf);
        return buf;
}

vi a, b;

int p, cur, n;

void go(int i, int l, int need){
	int ind = (l == 1) ? p : ((p - 1) + n) % n;
	while(cur + a[p] >= b[ind]){
		cur += (a[p] - b[ind]);
		p += l;
		p = (p + n) % n;
		ind = (l == 1) ? p : ((p - 1) + n) % n;
		if(p == need)
			return;
	}
}

int main(){
        #ifdef _DEBUG
                #define FILENAME "test"
                freopen (FILENAME".in", "rt", stdin);
        freopen (FILENAME".out", "wt", stdout);
        #endif
        ios_base::sync_with_stdio(0);
		cin >> n;
		a.resize(n), b.resize(n);
		rep(i, n)
			scanf("%d", &a[i]);
		rep(i, n)
			scanf("%d", &b[i]);
		p = 0, cur = 0;
		go(0, 1, 0);
		vi ans;
		if(p == 0 && a[0] >= b[0]){
			ans.pb(0);
		}
		for(int i = n - 1; i > 0; i--){
			if(a[i] < b[i]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i]);
				go(p, 1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		p = 0, cur = 0;
		go(0, -1, 0);
		if(p == 0 && a[0] >= b[n - 1]){
			ans.pb(0);
		}
		forn(i, 1, n){
			if(a[i] < b[i - 1]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i - 1]);
				go(p, -1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		vector < bool > res(n, false);
		rep(i, sz(ans))
			res[ans[i]] = true;
		ans.clear();
		rep(i, n)
			if(res[i])
				ans.pb(i);
		cout << sz(ans) << "\n";
		rep(i, sz(ans))
			printf("%i ", ans[i] + 1);// << " ";
		return 0;
}


#pragma comment(linker, "/STACK:136777216")

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <complex>

using namespace std;

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define forn(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define each(it, v) for (__typeof(v) it = v.begin(); it != v.end(); it++)
#define mp make_pair
#define pb push_back
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define sqr(x) (x) * (x)
#define dbg(v) rep(i, sz(v)) cout << v[i] << " "; cout << "\n"
#define dbg2(n) cout << #n << ": " << n << "\n"
#define subsub(n) rep(i, 1 << n) for (int j = i; j > 0; j = (j - 1) & i)
#define fi first
#define se second

typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <vi> vvi;

int bits (int x) { return x == 0? 0: 1 + bits(x & (x - 1)); }

const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 1000000000;

typedef complex < double > base;
typedef vector < base > vb;

string nextString(){
        char buf[300000];
        scanf("%s", buf);
        return buf;
}

vi a, b;

int p, cur, n;

void go(int i, int l, int need){
	int ind = (l == 1) ? p : ((p - 1) + n) % n;
	while(cur + a[p] >= b[ind]){
		cur += (a[p] - b[ind]);
		p += l;
		p = (p + n) % n;
		ind = (l == 1) ? p : ((p - 1) + n) % n;
		if(p == need)
			return;
	}
}

int main(){
        #ifdef _DEBUG
                #define FILENAME "test"
                freopen (FILENAME".in", "rt", stdin);
        freopen (FILENAME".out", "wt", stdout);
        #endif
        ios_base::sync_with_stdio(0);
		cin >> n;
		a.resize(n), b.resize(n);
		rep(i, n)
			scanf("%i", &a[i]);
		rep(i, n)
			scanf("%i", &b[i]);
		p = 0, cur = 0;
		go(0, 1, 0);
		vi ans;
		if(p == 0 && a[0] >= b[0]){
			ans.pb(0);
		}
		for(int i = n - 1; i > 0; i--){
			if(a[i] < b[i]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i]);
				go(p, 1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		p = 0, cur = 0;
		go(0, -1, 0);
		if(p == 0 && a[0] >= b[n - 1]){
			ans.pb(0);
		}
		forn(i, 1, n){
			if(a[i] < b[i - 1]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i - 1]);
				go(p, -1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		vector < bool > res(n, false);
		rep(i, sz(ans))
			res[ans[i]] = true;
		ans.clear();
		rep(i, n)
			if(res[i])
				ans.pb(i);
		cout << sz(ans) << "\n";
		rep(i, sz(ans))
			printf("%i ", ans[i] + 1);// << " ";
		return 0;
}


#pragma comment(linker, "/STACK:136777216")

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <complex>

using namespace std;

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define forn(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define each(it, v) for (__typeof(v) it = v.begin(); it != v.end(); it++)
#define mp make_pair
#define pb push_back
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define sqr(x) (x) * (x)
#define dbg(v) rep(i, sz(v)) cout << v[i] << " "; cout << "\n"
#define dbg2(n) cout << #n << ": " << n << "\n"
#define subsub(n) rep(i, 1 << n) for (int j = i; j > 0; j = (j - 1) & i)
#define fi first
#define se second

typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <vi> vvi;

int bits (int x) { return x == 0? 0: 1 + bits(x & (x - 1)); }

const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 1000000000;

typedef complex < double > base;
typedef vector < base > vb;

string nextString(){
        char buf[300000];
        scanf("%s", buf);
        return buf;
}

vi a, b;

int p, cur, n;

void go(int i, int l, int need){
	int ind = (l == 1) ? p : ((p - 1) + n) % n;
	while(cur + a[p] >= b[ind]){
		cur += (a[p] - b[ind]);
		p += l;
		p = (p + n) % n;
		ind = (l == 1) ? p : ((p - 1) + n) % n;
		if(p == need)
			return;
	}
}

int main(){
        #ifdef _DEBUG
                #define FILENAME "test"
                freopen (FILENAME".in", "rt", stdin);
				freopen (FILENAME".out", "wt", stdout);
        #endif
        //ios_base::sync_with_stdio(0);
		cin >> n;
		a.resize(n), b.resize(n);
		rep(i, n)
			scanf("%d", &a[i]);
		rep(i, n)
			scanf("%d", &b[i]);
		p = 0, cur = 0;
		go(0, 1, 0);
		vi ans;
		if(p == 0 && a[0] >= b[0]){
			ans.pb(0);
		}
		for(int i = n - 1; i > 0; i--){
			if(a[i] < b[i]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i]);
				go(p, 1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		p = 0, cur = 0;
		go(0, -1, 0);
		if(p == 0 && a[0] >= b[n - 1]){
			ans.pb(0);
		}
		forn(i, 1, n){
			if(a[i] < b[i - 1]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i - 1]);
				go(p, -1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		vector < bool > res(n, false);
		rep(i, sz(ans))
			res[ans[i]] = true;
		ans.clear();
		rep(i, n)
			if(res[i])
				ans.pb(i);
		cout << sz(ans) << "\n";
		rep(i, sz(ans))
			printf("%i ", ans[i] + 1);// << " ";
		return 0;
}


#pragma comment(linker, "/STACK:136777216")

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <complex>

using namespace std;

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define forn(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define each(it, v) for (__typeof(v) it = v.begin(); it != v.end(); it++)
#define mp make_pair
#define pb push_back
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define sqr(x) (x) * (x)
#define dbg(v) rep(i, sz(v)) cout << v[i] << " "; cout << "\n"
#define dbg2(n) cout << #n << ": " << n << "\n"
#define subsub(n) rep(i, 1 << n) for (int j = i; j > 0; j = (j - 1) & i)
#define fi first
#define se second

typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <vi> vvi;

int bits (int x) { return x == 0? 0: 1 + bits(x & (x - 1)); }

const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 1000000000;

typedef complex < double > base;
typedef vector < base > vb;

string nextString(){
        char buf[300000];
        scanf("%s", buf);
        return buf;
}

vi a, b;

int p, cur, n;

void go(int i, int l, int need){
	int ind = (l == 1) ? p : ((p - 1) + n) % n;
	while(cur + a[p] >= b[ind]){
		cur += (a[p] - b[ind]);
		p += l;
		p = (p + n) % n;
		ind = (l == 1) ? p : ((p - 1) + n) % n;
		if(p == need)
			return;
	}
}

int main(){
        #ifdef _DEBUG
                #define FILENAME "test"
                freopen (FILENAME".in", "rt", stdin);
        freopen (FILENAME".out", "wt", stdout);
        #endif
        ios_base::sync_with_stdio(0);
		cin >> n;
		a.resize(n), b.resize(n);
		rep(i, n)
			cin >> a[i];
		rep(i, n)
			cin >> b[i];
		p = 0, cur = 0;
		go(0, 1, 0);
		vi ans;
		if(p == 0 && a[0] >= b[0]){
			ans.pb(0);
		}
		for(int i = n - 1; i > 0; i--){
			if(a[i] < b[i]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i]);
				go(p, 1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		p = 0, cur = 0;
		go(0, -1, 0);
		if(p == 0 && a[0] >= b[n - 1]){
			ans.pb(0);
		}
		forn(i, 1, n){
			if(a[i] < b[i - 1]){
				p = i;
				cur = 0;
				continue;
			}
			else{
				cur += (a[i] - b[i - 1]);
				go(p, -1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		vector < bool > res(n, false);
		rep(i, sz(ans))
			res[ans[i]] = true;
		ans.clear();
		rep(i, n)
			if(res[i])
				ans.pb(i);
		cout << sz(ans) << "\n";
		rep(i, sz(ans))
			cout << ans[i] + 1 << " ";
		return 0;
}


#pragma comment(linker, "/STACK:136777216")

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <complex>

using namespace std;

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define forn(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define each(it, v) for (__typeof(v) it = v.begin(); it != v.end(); it++)
#define mp make_pair
#define pb push_back
#define sz(v) (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define sqr(x) (x) * (x)
#define dbg(v) rep(i, sz(v)) cout << v[i] << " "; cout << "\n"
#define dbg2(n) cout << #n << ": " << n << "\n"
#define subsub(n) rep(i, 1 << n) for (int j = i; j > 0; j = (j - 1) & i)
#define fi first
#define se second

typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <vi> vvi;

int bits (int x) { return x == 0? 0: 1 + bits(x & (x - 1)); }

const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 1000000000;

typedef complex < double > base;
typedef vector < base > vb;

string nextString(){
        char buf[300000];
        scanf("%s", buf);
        return buf;
}

vi a, b;

int p, cur, n;

void go(int i, int l, int need){
	int ind = (l == 1) ? p : ((p - 1) + n) % n;
	while(cur + a[p] >= b[ind]){
		cur += (a[p] - b[ind]);
		p += l;
		p = (p + n) % n;
		ind = (l == 1) ? p : ((p - 1) + n) % n;
		if(p == need)
			return;
	}
}

int main(){
        #ifdef _DEBUG
                #define FILENAME "test"
                freopen (FILENAME".in", "rt", stdin);
        freopen (FILENAME".out", "wt", stdout);
        #endif
        ios_base::sync_with_stdio(0);
		cin >> n;
		a.resize(n), b.resize(n);
		rep(i, n)
			cin >> a[i];
		rep(i, n)
			cin >> b[i];
		p = 0, cur = 0;
		go(0, 1, 0);
		vi ans;
		if(p == 0 && a[0] >= b[0]){
			ans.pb(0);
		}
		for(int i = n - 1; i > 0; i--){
			if(a[i] < b[i]){
				p = i;
				continue;
			}
			else{
				cur += (a[i] - b[i]);
				go(p, 1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		p = 0, cur = 0;
		go(0, -1, 0);
		if(p == 0 && a[0] >= b[n - 1]){
			ans.pb(0);
		}
		forn(i, 1, n){
			if(a[i] < b[i - 1]){
				p = i;
				continue;
			}
			else{
				cur += (a[i] - b[i - 1]);
				go(p, -1, i);
			}
			if(p == i)
				ans.pb(i);
		}
		vector < bool > res(n, false);
		rep(i, sz(ans))
			res[ans[i]] = true;
		ans.clear();
		rep(i, n)
			if(res[i])
				ans.pb(i);
		cout << sz(ans) << "\n";
		rep(i, sz(ans))
			cout << ans[i] + 1 << " ";
		return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <string>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cstdio>
#include <cassert>
#include <cstdlib>

using namespace std;

const int MAXN = 200050;
const int INF = 1<<30;

int a[MAXN<<1], b[MAXN<<1], c[MAXN<<1];
int n;

struct SegTree{
    int left, right;
    int minval;
    int add;
}T[MAXN*8];

inline int exist(int x) {
    return T[x].left<=T[x].right;
}

inline void refresh(int x) {
    int ll = INF, lr = INF;
    if (exist(x<<1)) ll = T[x<<1].minval;
    if (exist((x<<1)|1)) lr = T[(x<<1)|1].minval;
    T[x].minval = min(ll, lr);
}

inline void push(int x) {
    if (T[x].add) {
        if (exist(x<<1)) {
            T[x<<1].add += T[x].add;
            T[x<<1].minval += T[x].add;
        }
        if (exist((x<<1)|1)) {
            T[(x<<1)|1].add += T[x].add;
            T[(x<<1)|1].minval += T[x].add;
        }
        T[x].add = 0;
    }
}

void build(int x, int l, int r) {
    T[x].left = l;
    T[x].right = r;
    T[x].minval = INF;
    T[x].add = 0;

    if (l>r) return;
    if (l==r) {
        T[x].minval = c[l];
        return;
    }

    int mid = (l+r) >> 1;
    build(x<<1, l, mid);
    build((x<<1)|1, mid+1, r);

    refresh(x);
}

int query(int x, int l, int r) {
    if (!exist(x)) return INF;
    push(x);
    if (l==T[x].left && r==T[x].right) {
        return T[x].minval;
    }

    int mid = (T[x].left + T[x].right) >> 1;

    if (mid>=r) {
        return query(x<<1, l, r);
    } else if (mid+1<=l) {
        return query((x<<1)|1, l, r);
    } else {
        int ll = query(x<<1, l, mid);
        int rl = query((x<<1)|1, mid+1, r);
        return min(ll, rl);
    }

    refresh(x);
}

void update(int x, int l, int r, int v) {
    if (!exist(x)) return;
    if (l==T[x].left && r == T[x].right) {
        T[x].add += v;
        T[x].minval += v;
        return;
    }

    push(x);

    int mid = (T[x].left + T[x].right) >> 1;

    if (mid>=r) {
        update(x<<1, l, r, v);
    } else if (mid+1<=l) {
        update((x<<1)|1, l, r, v);
    } else {
        update(x<<1, l, mid, v);
        update((x<<1)|1, mid+1, r, v);
    }

    refresh(x);
}

void edit(int x, int p) {
    if (!exist(x)) assert(0);
    if (T[x].left == T[x].right) {
        T[x].minval = 0;
        return;
    }

    push(x);

    int mid = (T[x].left + T[x].right) >> 1;

    if (p<=mid) {
        edit(x<<1, p);
    } else {
        edit((x<<1)|1, p);
    }

    refresh(x);
}

int ans[MAXN];

void doit() {
	if (scanf("%d", &n) == EOF) exit(0);
	for (int i=1; i<=n; ++i) {
        scanf("%d", &a[i]);
	}
	for (int i=1; i<=n; ++i) {
        scanf("%d", &b[i]);
	}

	if (n==1) {
        printf("1\n");
        printf("1\n");
        return;
	}

    int sum = 0;
    memset(c, 0, sizeof(c));

	for (int i=1; i<=n; ++i) {
        c[i] = a[i] - b[i];
        sum += c[i];
        c[i] = sum;
	}

	build(1, 1, 2*n);

	int anss = 0;

	for (int i=1; i<=n; ++i)  {
	    int tt = query(1, i, i+n-1);
	    if (tt>=0) {
            ans[anss++] = i;
	    }
	    int addition = query(1, i, i);
	    edit(1, i);
	    update(1, i+1, i+n-1, -addition);
	}

    sum = 0;
    memset(c, 0, sizeof(c));

    b[0] = b[n];
	for (int i=n*2; i>=n+1; --i) {
        c[i] = a[i-n] - b[i-1-n];
        sum += c[i];
        c[i] = sum;
	}

	build(1, 1, 2*n);

	for (int i=2*n; i>=n+1; --i)  {
	    int tt = query(1, i-n+1, i);
	    if (tt>=0) {
            ans[anss++] = i-n;
	    }
	    int addition = query(1, i, i);
	    edit(1, i);
	    update(1, i-n, i-1, -addition);
	}

    sort(ans, ans+anss);

    int ranss = 0;

    for (int i=0;i<anss; ++i) {
        if ((!i) || ans[i]!=ans[i-1]) {
            ranss++;
        }
    }

    printf("%d\n", ranss);

    for (int i=0;i<anss; ++i) {
        if ((!i) || ans[i]!=ans[i-1]) {
            if (!i) printf("%d", ans[i]);
            else printf(" %d", ans[i]);
        }
    }
    printf("\n");
}

int main() {
#ifdef _ATTIIX_
	freopen("in.txt", "r", stdin);
#endif

	while (1) {
		doit();
	}

    return 0;
}

/*megikcasnnsqitfokrlqnhdbgopmcgthcrpmthcenbanarhdpk*/


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
using namespace std;
#define INF 1000000000
const int maxn=100005;
int a[maxn],b[maxn],tmp[maxn];
bool ans[maxn];
int n;
int main()
{
    scanf("%d",&n);
    for(int i=1; i<=n; i++)scanf("%d",&a[i]);
    for(int i=1; i<=n; i++)scanf("%d",&b[i]);

    for(int i=1; i<=n; i++)tmp[i]=a[i]-b[i];
    for(int i=n; i>1; i--)
    {
        int j=i;
        while(tmp[j]<0)
        {
            tmp[j-1]+=tmp[j];
            j--;
            if(j==1)break;
        }
        i=j;
    }
    for(int i=1; i<=n; i++)if(tmp[i]>=0)ans[i]=1;
    b[0]=b[n];
    for(int i=1; i<=n; i++)tmp[i]=a[i]-b[i-1];
    for(int i=1; i<n; i++)
    {
        int j=i;
        while(tmp[j]<0)
        {
            tmp[j+1]+=tmp[j];
            j++;
            if(j==n)break;
        }
        i=j;
    }
    for(int i=1; i<=n; i++)
        if(tmp[i]>=0)ans[i]=1;
    int cou=0;
    for(int i=1; i<=n; i++)
        if(ans[i])cou++;
    printf("%d\n",cou);
    int flag=0;
    for(int i=1; i<=n; i++)
        if(ans[i])
        {
            if(flag)printf(" %d",i);
            else
            {
                flag=1;
                printf("%d",i);
            }
        }
    printf("\n");
    return 0;
}

/*rdshqadlfimbnmjsepmqsqpnsrttmtfccpjlpncnnggsspiocm*/


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define N 100000+5
int a[N],b[N];
int f[N][2],ans[N];
int main()
{
    //freopen("in.cpp","r",stdin);
    int n,i,j,k;
    while(scanf("%d",&n)+1){
        memset(f,-1,sizeof(f));
        for(i=0;i<n;i++)
        scanf("%d",&a[i]);
        for(i=0;i<n;i++){
            scanf("%d",&b[i]);
        }

        for(i=0;i<n;i++){
            int x=0,y=0;
            for(k=0;k<n;k++){
                j=(i+k)%n;
                if(f[j][0]==1){
                    f[i][0]=1;
                    break;
                }
                x+=a[j];
                y+=b[j];
                if(x<y) break;
            }
            if(k==n){
                f[i][0]=1;
            }

        }
        for(i=0;i<n;i++){
            //if(f[i][0]==1) continue;
            int x=0,y=0;
            for(k=0;k<n;k++){

                j=(n+i-k)%n;
                int r=(n+i-k-1)%n;
                if(f[j][1]==1){
                    f[i][1]=1;
                    break;
                }
                x+=a[j];
                y+=b[r];
                if(x<y) break;
            }
            if(k==n) {
                   f[i][1]=1;
            }

        }
        k=0;
        for(i=0;i<n;i++)
        if(f[i][1]==1||f[i][0]==1) ans[k++]=i+1;
        printf("%d\n",k);
        for(i=0;i<k;i++)
        printf("%d%c",ans[i],i==k-1?'\n':' ');

    }
    return 0;
}

/*fffnlrqefkbrrtolsqjenrggrebfocrticettaprdioaajekrf*/


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define N 200000+5
int a[N],b[N],c[N];
int f[N],ans[N];
int main()
{
   // freopen("in.cpp","r",stdin);
    int n,i,j,k;
    while(scanf("%d",&n)+1){
        memset(f,0,sizeof(f));
        for(i=1;i<=n;i++){
            scanf("%d",&a[i]);
            a[i+n]=a[i];
        }
        for(i=1;i<=n;i++){
            scanf("%d",&b[i]);
            b[i+n]=b[i];
        }
        for(i=1;i<=2*n;i++)
        c[i]=a[i]-b[i];
        int tag=1000000000+1;
        int sum=0;
        for(k=0;k<n;k++){
            sum+=c[n+k];
            tag=min(tag,sum);
        }
        if(tag>=0) f[n]=true;
        for(i=n-1;i>0;i--){
            if(tag+c[i]>=0) f[i]=1;
            tag=tag+c[i];
        }

        b[0]=b[n];
        for(i=1;i<=2*n;i++)
        c[i]=a[i]-b[i-1];
        tag=1000000000+1;
        sum=0;
        for(k=0;k<n;k++){
            sum+=c[n-k];
            tag=min(tag,sum);
        }
        if(tag>=0) f[n]=true;
        for(i=n+1;i<=2*n;i++){
            if(tag+c[i]>=0) f[i-n]=true;
            tag=tag+c[i];
        }
        k=0;
        for(i=1;i<=n;i++)
        if(f[i]) ans[k++]=i;
       printf("%d\n",k);
       for(i=0;i<k;i++)
       printf("%d%c",ans[i],i==k-1?'\n':' ');

    }
    return 0;
}

/*gqrfakgiflrjqdnlqtftnoqorjdhpdsbtpglgealijmqmftire*/


#include <cstdio>
using namespace std;
int a[2*500005];
int b[2*500005];
int vis[2*500005];
int main()
{
    int n;
    int k;
    scanf("%d",&n);
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&k);
        a[i]=a[i+n]=k;
    }
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&k);
        b[i]=b[i+n]=k;
    }
    int l,r;
    int ans=0;
    l=1;
    r=1;
    while(l<=n)
    {
        r=l+1;
        int sum=a[l]-b[l];
       // printf("%d\n",l);
        while(sum>=0)
        {
            //printf("%d ",sum);
            sum+=(a[r]-b[r]);
            if(sum<0) break;
            if(r-l==n)
            {
                ans++;
                vis[l+n]=1;
               // printf("ok");
                break;
            }
            r++;
        }
        l++;
       // printf("\n");
    }
    r=n+n;
    while(r>n)
    {
        if(!vis[r])
        {
            l=r-1;
            int sum=a[r]-b[r-1];
          //  printf("%d ",r-n);
            while(sum>=0)
            {
                //printf("%d ",sum);
                sum+=(a[l]-b[l-1]);
                if(sum<0) break;
                if(r-l==n)
                {
                    ans++;
                    vis[r]=1;
                   // printf("ok");
                    break;
                }
                l--;
            }

        }
        r--;
      //  printf("\n");
    }
    printf("%d\n",ans);
    for(int i=n; i<=2*n; i++)
    {
        if(vis[i]) printf("%d ",i-n);
    }

}

/*kbihcgidienstqobrgqnsjdgtjhlckdmddtfbiijeohpknqtmm*/


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
using namespace std;
#define INF 1000000000
const int maxn=100005;
int a[maxn],b[maxn],tmp[maxn];
bool ans[maxn];
int n;
int main()
{
    scanf("%d",&n);
    for(int i=1; i<=n; i++)scanf("%d",&a[i]);
    for(int i=1; i<=n; i++)scanf("%d",&b[i]);
    if(n==1)printf("1\n1\n");
    else
    {
        for(int i=1; i<=n; i++)tmp[i]=a[i]-b[i];
        int sign=0;
        if(tmp[1]<0)
        {
            tmp[n]+=tmp[1];
            sign=1;
        }
        for(int i=n; i>=2; i--)
        {
            int j=i;
            while(tmp[j]<0)
            {
                tmp[j-1]+=tmp[j];
                j--;
                if((sign&&j==2)||(!sign&&j==1))break;
            }
            i=j;
        }
        for(int i=1; i<=n; i++)if(tmp[i]>=0)ans[i]=1;
        b[0]=b[n];
        for(int i=1; i<=n; i++)tmp[i]=a[i]-b[i-1];
        sign=0;
        if(tmp[n]<0)
        {
            tmp[1]+=tmp[n];
            sign=1;
        }
        for(int i=1; i<n; i++)
        {
            int j=i;
            while(tmp[j]<0)
            {
                tmp[j+1]+=tmp[j];
                j++;
                if((sign&&j==n-1)||(!sign&&j==n))break;
            }
            i=j;
        }
        for(int i=1; i<=n; i++)
            if(tmp[i]>=0)ans[i]=1;
        int cou=0;
        for(int i=1; i<=n; i++)
            if(ans[i])cou++;
        printf("%d\n",cou);
        int flag=0;
        for(int i=1; i<=n; i++)
            if(ans[i])
            {
                if(flag)printf(" %d",i);
                else
                {
                    flag=1;
                    printf("%d",i);
                }
            }
        printf("\n");
    }
    return 0;
}

/*eltjbhsmbcgakplgjndqbtqqtisrdegipfjqmtbgchseobkeon*/


#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
    int t,n,x,i;
    scanf("%d",&t);
    while (t--)
    {
        scanf("%d",&n);
        for (i=0;i<n;i++)
        scanf("%d",&x);
        for (i=0;i<n;i++)
        scanf("%d",&x);
        printf("Case %d:\n");
        printf("WTF\n");
    }
    return 0;
}

/*pntlanpmrdkondoqlelfdhlfrholaqtpbssndnfnqhhbknkcjb*/


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
using namespace std;
#define INF 1000000000
const int maxn=100005;
int a[maxn],b[maxn],tmp[maxn];
bool ans[maxn];
int n;
int main()
{
    scanf("%d",&n);
    for(int i=1; i<=n; i++)scanf("%d",&a[i]);
    for(int i=1; i<=n; i++)scanf("%d",&b[i]);
    if(n==1)printf("1\n1\n");
    else
    {
        for(int i=1; i<=n; i++)tmp[i]=a[i]-b[i];
        if(tmp[1]<0)
        {
            tmp[n]+=tmp[1];
        }
        for(int i=n; i>=2; i--)
        {
            int j=i;
            while(tmp[j]<0)
            {
                tmp[j-1]+=tmp[j];
                j--;
                if(j==1)break;
            }
            i=j;
        }
        for(int i=1; i<=n; i++)if(tmp[i]>=0)ans[i]=1;
        b[0]=b[n];
        for(int i=1; i<=n; i++)tmp[i]=a[i]-b[i-1];
        if(tmp[n]<0)
        {
            tmp[1]+=tmp[n];
        }
        for(int i=1; i<n; i++)
        {
            int j=i;
            while(tmp[j]<0)
            {
                tmp[j+1]+=tmp[j];
                j++;
                if(j==n)break;
            }
            i=j;
        }
        for(int i=1; i<=n; i++)
            if(tmp[i]>=0)ans[i]=1;
        int cou=0;
        for(int i=1; i<=n; i++)
            if(ans[i])cou++;
        printf("%d\n",cou);
        int flag=0;
        for(int i=1; i<=n; i++)
            if(ans[i])
            {
                if(flag)printf(" %d",i);
                else
                {
                    flag=1;
                    printf("%d",i);
                }
            }
        printf("\n");
    }
    return 0;
}

/*flredeqfpjedlhfoaccpkklpqibofrekibherpbnegiifoorqq*/


#include <iostream>
using namespace std;
int main()
{
    int i,j,k,ans=0;
    int n;
    cin>>n;
    int a[n+5];
    int b[n+5];
    int ok[n+5][2];

    for(i=1; i<=n; i++)
        cin>>a[i];
    for(i=1; i<=n; i++)
        cin>>b[i];
    for(i=1; i<=n; i++)
    {

        int sum=a[i];
        int L=1,R=1;
        //走 右边
        j=i;
        k=0;
        while(1)
        {
            if(j==i) k=1;
            sum-=b[j];
            if(sum<0){ R=0; break; }
            if(j==n) j=1;
            else j++;
            if(ok[j][0]) break;
            sum+=a[j];
            if(j==i&&k) break;

        }
        ok[i][0]=R;
        //左边
        sum=a[i];
        j=i;
        k=0;
        while(1)
        {
            //cout<<sum<<" ";
            if(j==i) k=1;
            if(j==1) j=n;
            else j--;
            if(sum<b[j]){ L=0;break; }
            sum-=b[j];
           // if(j==1) j=n;
            //else j--;
            if(ok[j][1]) break;
            sum+=a[j];
            if(j==i&&k) break;
        }
        //cout<<L<<" 1236 "<<endl;
        ok[i][1]=L;
        if(ok[i][0]||ok[i][1]) ans++;
        //cout<<i<<" "<<L<<" "<<R<<endl;
    }
   // for(i=1; i<=n; i++)
    //{
        //if(ok[i][0]||ok[i][1]) ans++;
    //}
    cout<<ans<<endl;
    for(i=1; i<=n; i++)
    {
        if(ok[i][0]||ok[i][1])
        {
            cout<<i;
        if(i!=n) cout<<" ";
        }

    }
}
//4 1 7 2 3 8 1 1 3

/*rijanbgtjrlaisrfheetmqimhtgfrkfokoheqfpfchrlfhiele*/


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <string>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cstdio>
#include <cassert>
#include <cstdlib>

using namespace std;

const int MAXN = 200050;
const int INF = 1<<30;

int a[MAXN<<1], b[MAXN<<1], c[MAXN<<1];
int n;

//int heap[MAXN*4];
//int size;
//
//void push_up(int p) {
//    if (p==1) return;
//    if (heap[p]<heap[p>>1]) {
//        swap(heap[p], heap[p>>1]);
//        push_up(p>>1);
//    }
//}
//
//int push_down(int p) {
//    int target = p;
//    if ((p<<1) < size) {
//        if (heap[p<<1]<heap[p]) {
//            target = (p<<1);
//        }
//    }
//    if (((p<<1)|1) < size) {
//        if (heap[(p<<1)|1]<heap[target]) {
//            target = (p<<1)|1;
//        }
//    }
//
//    if (target!=p) {
//        swap(heap[p], heap[target]);
//        return push_down(target);
//    }
//
//    return p;
//}
//
//void insert(int x) {
//    heap[size++] = x;
//    int now = size-1;
//    push_up(now);
//}
//
//int top() {
//    return heap[1];
//}
//
//void pop(int p) {
//    heap[1] = INF;
//    int del = push_down(1);
//    swap(heap[del], heap[size]);
//    --size;
//}
//
//void init_heap() {
//    size = 1;
//}
//
//void print_heap() {
//    for (int i=1; i<size; ++i) {
//        printf("%d ", heap[i]);
//    }
//    printf("\n");
//}

struct SegTree{
    int left, right;
    int minval;
    int add;
}T[MAXN*8];

inline int exist(int x) {
    return T[x].left<=T[x].right;
}

inline void refresh(int x) {
    int ll = INF, lr = INF;
    if (exist(x<<1)) ll = T[x<<1].minval;
    if (exist((x<<1)|1)) lr = T[(x<<1)|1].minval;
    T[x].minval = min(ll, lr);
}

inline void push(int x) {
    if (T[x].add) {
//        T[x].minval += T[x].add;
        if (exist(x<<1)) {
            T[x<<1].add += T[x].add;
            T[x<<1].minval += T[x].add;
        }
        if (exist((x<<1)|1)) {
            T[(x<<1)|1].add += T[x].add;
            T[(x<<1)|1].minval += T[x].add;
        }
        T[x].add = 0;
    }
}

void build(int x, int l, int r) {
//    printf("%d %d %d\n",x, l ,r);
    T[x].left = l;
    T[x].right = r;
    T[x].minval = INF;
    T[x].add = 0;

    if (l>r) return;
    if (l==r) {
        T[x].minval = c[l];
        return;
    }

    int mid = (l+r) >> 1;
    build(x<<1, l, mid);
    build((x<<1)|1, mid+1, r);

    refresh(x);
}

int query(int x, int l, int r) {
//    printf("%d %d\n", l, r);
    if (!exist(x)) return INF;
    push(x);
    if (l==T[x].left && r==T[x].right) {
//        printf("%d %d %d\n", l, r, T[x].minval);
        return T[x].minval;
    }

    int mid = (T[x].left + T[x].right) >> 1;

    if (mid>=r) {
        return query(x<<1, l, r);
    } else if (mid+1<=l) {
        return query((x<<1)|1, l, r);
    } else {
        int ll = query(x<<1, l, mid);
        int rl = query((x<<1)|1, mid+1, r);
        return min(ll, rl);
    }

    refresh(x);
}

void update(int x, int l, int r, int v) {
    if (!exist(x)) return;
    if (l==T[x].left && r == T[x].right) {
        T[x].add += v;
        T[x].minval += v;
        return;
    }

    push(x);

    int mid = (T[x].left + T[x].right) >> 1;

    if (mid>=r) {
        update(x<<1, l, r, v);
    } else if (mid+1<=l) {
        update((x<<1)|1, l, r, v);
    } else {
        update(x<<1, l, mid, v);
        update((x<<1)|1, mid+1, r, v);
    }

    refresh(x);
}

void edit(int x, int p) {
    if (!exist(x)) assert(0);
    if (T[x].left == T[x].right) {
        //int ret = T[x].minval;
        T[x].minval = 0;
        return;
//        return ret;
    }

    push(x);

    int mid = (T[x].left + T[x].right) >> 1;

    if (p<=mid) {
        edit(x<<1, p);
    } else {
        edit((x<<1)|1, p);
    }

    refresh(x);
}

void check(int delta) {
    --delta;
	for (int i=1+delta; i<=n+delta; ++i) {
        printf("%d ", query(1, i, i));
	}
	printf("\n");
}

int ans[MAXN];

void doit() {
	if (scanf("%d", &n) == EOF) exit(0);
	for (int i=1; i<=n; ++i) {
        scanf("%d", &a[i]);
	}
	for (int i=1; i<=n; ++i) {
        scanf("%d", &b[i]);
	}

	if (n==1) {
        printf("1\n");
        printf("1\n");
        return;
	}

    int sum = 0;
    memset(c, 0, sizeof(c));

	for (int i=1; i<=n; ++i) {
        c[i] = a[i] - b[i];
        sum += c[i];
        c[i] = sum;
//        printf("%d ", c[i]);
	}
//	printf("\n");

	build(1, 1, 2*n);

	int anss = 0;

	for (int i=1; i<=n; ++i)  {
//	    check(i);
//	    printf("QU : %d %d\n", i, i+n-1);
	    int tt = query(1, i, i+n-1);
//	    printf("T : %d\n", tt);
	    if (tt>=0) {
            ans[anss++] = i;
	    }
	    int addition = query(1, i, i);
	    edit(1, i);

//	    printf("A : %d\n", -addition);

	    update(1, i+1, i+n-1, -addition);
//	    printf("%d %d\n", i, i+n-1);
	}

//    printf("\n");

    sum = 0;
    memset(c, 0, sizeof(c));

    b[0] = b[n];
	for (int i=n*2; i>=n+1; --i) {
        c[i] = a[i-n] - b[i-1-n];
        sum += c[i];
        c[i] = sum;
	}

	build(1, 1, 2*n);

	for (int i=2*n; i>=n+1; --i)  {
	    int tt = query(1, i-n+1, i);
//	    printf("T : %d\n", tt);
	    if (tt>=0) {
            ans[anss++] = i-n;
	    }
	    int addition = query(1, i, i);
	    edit(1, i);

//	    printf("A : %d\n", -addition);

	    update(1, i-n, i-1, -addition);
	}

    sort(ans, ans+anss);

    int ranss = 0;

    for (int i=0;i<anss; ++i) {
        if ((!i) || ans[i]!=ans[i-1]) {
            ranss++;
        }
    }

    printf("%d\n", ranss);

    for (int i=0;i<anss; ++i) {
        if ((!i) || ans[i]!=ans[i-1]) {
            if (!i) printf("%d", ans[i]);
            else printf(" %d", ans[i]);
        }
    }
    printf("\n");
}

int main() {
#ifdef _ATTIIX_
	freopen("in.txt", "r", stdin);
#endif

	while (1) {
		doit();
	}

    return 0;
}

/*rkqkasaojgsijisqjocqhjrrtfqcfshoiprinroopeofmmnntq*/


#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

const int maxn = 200005;
int a[maxn],b[maxn];
int pos[maxn];
int hash[maxn];
int n;
int ans;

int getcal(int x,int y)
{
    if (x==n-1 && y==0) return b[n-1];
    if (y==n-1 && x==0) return b[n-1];
    if (x<=y) return b[x];
    else return b[y];
}
void doit()
{
    int sum=0,l,r;
    l=0;
    r=1;
    while (l<2*n)
    {
        while (sum>=0 && r<2*n)
        {
            sum=sum+a[pos[r-1]]-getcal(pos[r],pos[r-1]);
            r++;
            if (sum==0 && r-1-l==n)
            {
                if (hash[pos[l]]==0)
                {
                    ans++;
                    hash[pos[l]]=1;
                }
                break;
            }
        }
        l++;
        sum=sum-a[pos[l-1]]+getcal(pos[l],pos[l-1]);
    }
}
int main()
{
    int i,j;
    while (~scanf("%d",&n))
    {
        for (i=0;i<n;i++)
            scanf("%d",&a[i]);
        for (i=0;i<n;i++)
            scanf("%d",&b[i]);
        memset(hash,0,sizeof(hash));
        ans=0;
        j=0;
        for (i=0;i<2*n;i++)
        {
            pos[i]=j;
            j=(j+1)%n;
        }
        doit();

        j=n-1;
        for (i=1;i<2*n;i++)
        {
            pos[i]=j;
            j--;
            if (j<0) j=n-1;
        }
        doit();
        j=0;
        printf("%d\n",ans);
        for (i=0;i<n;i++)
        {
            if (hash[i]==1)
            {
                j++;
                if (j<ans) printf("%d ",i+1);
                else printf("%d\n",i+1);
            }
        }
    }
    return 0;
}

/*iifbjqlinnhdptftdfhbsdfkfcbdkdlklimaepbsbinqtsqppd*/


#include<stdio.h>
#include<algorithm>
#define MAX 100010
using namespace std;

int a[MAX],b[MAX],c[MAX],d[MAX],e[MAX];

bool cmp(int p,int q){
    return p<q;
}
int main(){
    int i,j,k;
    int n;
    int min1,min2;

    while(scanf("%d",&n)!=EOF){
        for(i=0;i<n;i++){
            scanf("%d",&a[i]);
        }
        for(i=0;i<n;i++){
            scanf("%d",&b[i]);
        }
        min1=1000000000;
        c[0]=0;
        for(i=1;i<n;i++){
            c[i]=c[i-1]+a[i-1]-b[i-1];
            if(c[i]<min1) min1=c[i];
        }
        if(min1>0) min1=0;
        d[n-1]=0;
        min2=1000000000;
        for(i=n-2;i>=0;i--){
            d[i]=d[i+1]+a[i+1]-b[i];
            if(d[i]<min2) min2=d[i];
        }
        if(min2>0) min2=0;
        int ans=0;
        for(i=0;i<n;i++){
            if(c[i]==min1){
                e[ans]=i+1;
                ans++;
            }
            else if(d[i]==min2){
                e[ans]=i+1;
                ans++;
            }
        }
        printf("%d\n",ans);
        sort(e,e+ans,cmp);
        for(i=0;i<ans;i++){
            printf("%d",e[i]);
            if(i!=ans-1) printf(" ");
            else printf("\n");
        }

    }

    return 0;
}

/*siseknnkjhmiipaairqmscodcmomgrmeflbiqgsfncnbsgnspk*/