stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <queue>

#include <stdio.h>

#include <string.h>

#define R register

#define MN 100005

std::deque<int> q;

int k,dis[MN];bool vis[MN];

int main(){

	scanf("%d",&k);

	memset(dis,0x3f,sizeof(dis));

	dis[1]=0;q.push_back(1);

	while(!q.empty()){

		R int x=q.front();q.pop_front();

		if (vis[x]) continue;

		if (!x) break;vis[x]=1;

		if (dis[x*10%k]>dis[x]){

			dis[x*10%k]=dis[x];

			q.push_front(x*10%k);

		}

		if (dis[x+1==k?0:x+1]>dis[x]+1){

			q.push_back(x+1==k?0:x+1);

			dis[x+1==k?0:x+1]=dis[x]+1;

		}

	}printf("%d\n",dis[0]+1);return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <queue>

#include <algorithm>

using namespace std;

typedef pair<int,int> P;

const int maxn=2e5+100;

int k;

bool vis[maxn];

 

int main()

{

    //freopen("1.txt","r",stdin);

    while (scanf("%d",&k)!=EOF)

    {

        memset(vis,0,sizeof(vis));

        deque<P> q;

        q.push_front(make_pair(1,1));

        while (!q.empty())

        {

            auto t=q.front(); q.pop_front();

            if (vis[t.first]) continue;

            vis[t.first]=1;

            if (t.first==0)

            {

                printf("%d\n",t.second);

                break;

            }

            q.push_front(make_pair(t.first*10%k,t.second));

            q.push_back(make_pair((t.first+1)%k,t.second+1));

        }

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <stdio.h>

#include <string.h>

#include <queue>

#define N 100010

int n,d[N];char inq[N];

inline int spfa(int s,int t) {

	std::queue<int> q;int u,v;

	memset(d,33,sizeof(d));

	q.push(s);d[s]=0;inq[s]=1;

	while(!q.empty()) {

		u=q.front();q.pop();inq[u]=0;

		v=u*10%n;

		if(d[u]<d[v]) {

			d[v]=d[u];

			if(!inq[v]) q.push(v),inq[v]=1;

		}

		v=u+1;if(v==n) v=0;

		if(d[u]+1<d[v]) {

			d[v]=d[u]+1;

			if(!inq[v]) q.push(v),inq[v]=1;

		}

	}

	return d[t];

}

int main() {

	scanf("%d",&n);

	printf("%d\n",1+spfa(1,0));

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <queue>

#include <algorithm>

using namespace std;

typedef pair<int,int> P;

const int maxn=2e5+100;

int k;

bool vis[maxn];

 

int main()

{

    //freopen("1.txt","r",stdin);

    while (scanf("%d",&k)!=EOF)

    {

        memset(vis,0,sizeof(vis));

        deque<P> q;

        q.push_front(make_pair(1,1));

        while (!q.empty())

        {

            auto t=q.front(); q.pop_front();

            if (vis[t.first]) continue;

            vis[t.first]=1;

            if (t.first==0)

            {

                printf("%d\n",t.second);

                break;

            }

            q.push_front(make_pair(t.first*10%k,t.second));

            q.push_back(make_pair((t.first+1)%k,t.second+1));

        }

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):


                                 /*Bismillahir Rahmanir Rahim*/





#include<bits/stdc++.h>

#include<cstring>

#include<vector>

#include<map>

#include<set>

#define ll long long int

#define dd double

using namespace std;



int main()

{

   ll a,b;

   cin>>a;

     dd  ans=( dd)a/3,ans1;

     ans1=pow(ans,3);

   

    cout<<fixed<<setprecision(10)<<ans1<<endl;



}

//Apna Time Aayega :)

// Optimized solution to the same problem (faster):
////jsjks



#include<stdio.h>

int main()

{

    double l,e;

   scanf("%lf",&l);

        

        e=(l/3.0)*(l/3.0)*(l/3.0);

        

        

   printf("%lf",e);

        

        

        

        

    

    

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<stdio.h>

#include<iostream>

#include<cmath>

#include<algorithm>

#include<vector>

#include<map>

#include<set>

#include<stack>

#include<iterator>

#include<iomanip>

#include<string>

using namespace std;



int main()

{

    double l;

    cin>>l;

    cout<<fixed<<setprecision(10)<<l*l*l/27;

    return 0;

}

// Optimized solution to the same problem (faster):
////jsjks



#include<stdio.h>

int main()

{

    double l,e;

   scanf("%lf",&l);

        

        e=(l/3.0)*(l/3.0)*(l/3.0);

        

        

   printf("%lf",e);

        

        

        

        

    

    

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	ios_base::sync_with_stdio(false);

	cin.tie(NULL);

	cout.tie(NULL);

	long double l,ans;

	cin>> l;

	ans=l/3.0;

	ans=ans*ans*ans;

	printf("%Lf",ans);

	

	

}

// Optimized solution to the same problem (faster):
////jsjks



#include<stdio.h>

int main()

{

    double l,e;

   scanf("%lf",&l);

        

        e=(l/3.0)*(l/3.0)*(l/3.0);

        

        

   printf("%lf",e);

        

        

        

        

    

    

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<iomanip>

using namespace std;

int main()

{

long double a,ans;

    cin>>a;

   a=a/3;

    ans=a*a*a;



    cout<<fixed<<setprecision(12)<<ans<<endl;



     return 0;

}


// Optimized solution to the same problem (faster):
////jsjks



#include<stdio.h>

int main()

{

    double l,e;

   scanf("%lf",&l);

        

        e=(l/3.0)*(l/3.0)*(l/3.0);

        

        

   printf("%lf",e);

        

        

        

        

    

    

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<iomanip>

using namespace std;

int main(){

    double n,result;

    cin>>n;

    n=n/3;

    result=n*n*n;

    printf("%.12f\n",(double)result);

}

// Optimized solution to the same problem (faster):


 #include <stdio.h>



#define LL long long



int main(){



	LL l;



	scanf("%lld",&l);



	printf("%.12lf\n",(l*l*l*1.0/(3*3*3)));



	return 0;}






// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define all(c) (c).begin(),(c).end()

#define pb push_back 

#define mp make_pair

typedef long long ll;







int main(){

	double l; cin>>l;	

	

	printf("%.10lf",(l/3)*(l/3)*(l/3));

			

	return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main()

{

 

   int L;

   double S;

   scanf("%d",&L);

    S = L/3.0;

   printf("%lf",S*S*S);

   return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

using namespace std;

int main(){

	double n;

	cin>>n;

	double x=n;

	double v=x*x*x/27;

	printf("%.12f",v);

} 

// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main()

{

 

   int L;

   double S;

   scanf("%d",&L);

    S = L/3.0;

   printf("%lf",S*S*S);

   return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cmath>

#include <iomanip>

using namespace std;



int main() {

	int L;

	cin >> L;

	double volume = pow((double)L / 3,3);

	cout << fixed << setprecision(12) << volume << endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main()

{

 

   int L;

   double S;

   scanf("%d",&L);

    S = L/3.0;

   printf("%lf",S*S*S);

   return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



int main() {

    int L;

    scanf("%d", &L);

    printf("%.12f\n", (double) L * L * L / 27);

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main()

{

 

   int L;

   double S;

   scanf("%d",&L);

    S = L/3.0;

   printf("%lf",S*S*S);

   return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main()

{

    int a,b,c;

    cin>>a>>b>>c;



    if(a==b)

        cout<<c<<endl;

    else if(a==c)

        cout<<b<<endl;

    else

        cout<<a<<endl;



	return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std ;



int main()



{

        int a,b,c;

        cin>>a>>b>>c;

        if(a==b&&a!=c)

            cout<<c;

       else if(b==c&& b!=a)

        cout<<a;

       else cout<<b;

     return 0;

}




// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <bits/stdc++.h>

#include <algorithm>

#include <string>

using namespace std;



int main()

{

    int a,b,c;

    cin>>a>>b>>c;

    if(a==b) cout<<c;

    if(a==c) cout<<b;

    if(b==c) cout<<a;



    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;



int main(){

	int a, b, c;

	cin >> a >> b >> c;

	if (a == b){

		cout << c << endl;

	}

	else if (a == c){

			cout << b << endl;

		}

	else {

		cout << a << endl;

	}

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int a, b, c;

int main () {

	cin >> a >> b >> c;

	if (a == b){

		cout << c << endl;

	}

	else if (a == c){

		cout << b << endl;

	}

	else if (b == c){

		cout << a << endl;

	}

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main()

{

    int a,b,c,diff;

    cin>>a>>b>>c;

    if(a==b){

        diff=c;

        cout<<diff<<endl;

    }

    else if(a==c){

        diff=b;

        cout<<diff<<endl;

    }

    else{

        diff=a;

        cout<<diff<<endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;



int main()

{

int A,B,C;

cin>>A>>B>>C;

if(A==B)

	cout<<C;

else if (A==C)

	cout<<B;

else 

	cout<<A;		



}




// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;



int main()

{

    int A,B,C;

    cin>>A>>B>>C;

    if(A==B){

        cout<<C;

    }

    else if(A==C){

        cout<<B;

    }

    else{

        cout<<A;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;



int main()

{

    int a,b,c ;

    cin >>a>>b>> c ;

    if (a==b){

        cout << c << endl;

    }else if (a==c){

    cout <<b<<endl;

    }else{

    cout<<a<< endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;



int main()



{

int x,z,y;





cin>>x>>y>>z;





if (x==y){

    cout <<z;

}



else if(x==z){

    cout<<y;

}

else{

    cout<<x;

}



 return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;



int main()

{

int A,B,C;

cin>>A>>B>>C;

int x=A;

if(x==B){

    cout<<C<<endl;

}

else if(x==C){

    cout<<B<<endl;

}

else

    cout<<A<<endl;















return 0;

}




// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;



int main(){

    int A,B,C;

    cin>>A>>B>>C;

    if(A==B){

        cout<<C<<endl;

    }

    else if(A==C){

        cout<<B<<endl;

    }

    else if(B==C){

        cout<<A<<endl;

    }



    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;



int main()

{

    int a,b,c;

    cin>>a>>b>>c;



     if(a==b   )

       cout<<c;

    else if(a==c )

        cout<<b;

     else

         cout<<a;





    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



int main() {

    int a ,b,c ;

    std::cin>>a;

    std::cin>>b;

    std::cin>>c;

    if (a == b){

        std::cout<<c<< "\n";

    }

    else if (a==c ){

        std::cout<<b<<"\n";

    }

    else if (b==c){

        std::cout<<a;

    }

    else {

        std::cout<<"invaild error";

    }

     }

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int main()

{

	int A, B, C;

	cin >> A >> B >> C;

	if (A == B)

		cout << C << endl;

	else if (A == C)

		cout << B << endl;

	else if (B == C)

		cout << A << endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

  int main()

  {

      int a,b,c;

      cin >> a >>b >> c;

      if(a==b)

        cout << c<< endl;

      else if (b==c)

        cout << a << endl;

      else

        cout << b<< endl;

      return 0;



  }

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;



int main()

{

    int a,b,c;

    cin>>a>>b>>c;

    if(a==b)

        cout<<c<<endl;

    else if(a==c)

        cout<<b<<endl;

    else if(c==b)

        cout<<a<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main()

{

    int a,b,c;



    scanf("%d %d %d", &a, &b, &c);



    if (a!=b && a!=c) printf("%d",a);

    else if (b!=a && b!=c) printf("%d",b);

    else if (c!=a && c!=a) printf("%d",c);



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int Max=1e5+10;

const int MOD=1e9+7;

int a[Max];

int pos[Max];

ll inv[Max];

ll fac[Max];

int sp;

int ss;

void init() {

    fac[0]=1;

    fac[1]=1;

    inv[0]=1;

    inv[1]=1;

    for(ll i=2; i<=Max; i++) {

        fac[i]=fac[i-1]*i%MOD;

        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;

    }

    for(ll i=1; i<=Max; i++)

        inv[i]=inv[i]*inv[i-1]%MOD;

}

ll C(ll n, ll m) {

    if(m>n)

        return 0;

    return ((fac[n]*inv[m]%MOD)*inv[n-m])%MOD;

}

int main(){

    ios::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

    int n;

    cin>>n;

    init();

    for(int i=1;i<=n+1;i++){

        cin>>a[i];

        if(pos[a[i]]){

            ss=a[i];

            sp=i;

        }else{

            pos[a[i]]=i;

        }

    }

    for(int i=0;i<=n;i++){

        ll res=0;

        res+=C(n+1,i+1);

        res%=MOD;

        res=(res+MOD-C(n-sp+pos[a[sp]],i))%MOD;

        cout<<res<<endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair<int, int> pii;

typedef pair<int, pii> pipii;

typedef pair<pii, int> piipi;

typedef pair<pii, pii> piipii;



#define mp make_pair

#define fi first

#define se second

#define all(a) (a).begin(), (a).end()

#define sz(a) (int)(a).size()

#define eb emplace_back

const int mod = 1e9+7;



int a[100005];

bool vis[100005];

ll f1[100005], f2[100005];

ll pw(ll a, ll b){

    ll ans = 1;

    while(b){

        if(b%2 == 1) ans = ans*a%mod;

        a = a*a%mod;

        b/=2;

    }

    return ans;

}

ll func(int a, int b){

    if(b > a) return 0;

    return f1[a]*f2[b]%mod*f2[a-b]%mod;

}



int main(){

    int n, l, r;

    scanf("%d", &n);

    f1[0] = f2[0] = 1;

    for(int i=1;i<=n+1;i++){

        f1[i] = f1[i-1]*i%mod;

        f2[i] = pw(f1[i], mod-2);

    }

    for(int i=1;i<=n+1;i++){

        scanf("%d", &a[i]);

        if(vis[a[i]]) r = i;

        vis[a[i]] = 1;

    }

    for(int i=1;i<=n+1;i++){

        if(a[i] == a[r]){

            l = i;

            break;

        }

    }

    for(int i=1;i<=n+1;i++){

        if(i == 1) printf("%d\n", n);

        else if(i == n+1) printf("1\n");

        else{

            ll ans = func(n+1, i);

            ans = (ans - func(n+1-(r-l+1), i-1) + mod)%mod;

            printf("%lld\n", ans);

        }

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include "bits/stdc++.h"

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)

#define REP(i,x,n) for(int i=x;i<n;i++)

#define ALL(v) (v).begin(),(v).end()

typedef long long LL;

typedef pair<int, int> PI;

typedef vector<int> VI;

const LL MOD = 1000000007LL;

VI pos[100001];

LL fact[100001];

LL inv[100001];

LL inv_fact[100001];

LL mod_pow(LL x, LL a) {

	if (a == 0) return 1;

	if (a % 2 == 0) {

		LL ret = mod_pow(x, a / 2);

		return (ret*ret) % MOD;

	}

	else {

		return (x*mod_pow(x, a - 1)) % MOD;

	}

}

LL comb(LL n, LL k) {

	if (n < k) return 0;

	LL ans = (fact[n] * inv_fact[k]) % MOD;

	ans = (ans*inv_fact[n - k]) % MOD;

	return ans;

}

int main() {

	int n;

	cin >> n;

	rep(i, n+1) {

		int a;

		cin >> a;

		pos[a].push_back(i);

	}

	int x;

	REP(i, 1, n + 1) {

		if (pos[i].size() == 2) {

			x = i;

			break;

		}

	}

	REP(i, 1, n + 1) {

		inv[i] = mod_pow(i, MOD - 2);

	}

	fact[0] = 1;

	inv_fact[0] = 1;

	REP(i, 1, n + 1) {

		fact[i] = (fact[i - 1] * i) % MOD;

		inv_fact[i] = (inv_fact[i - 1] * inv[i]) % MOD;

	}

	cout << n << endl;

	REP(i, 2, n + 2) {

		LL ans = (comb(n - 1, i - 2) + comb(n - 1, i)) % MOD;

		ans = (ans + 2*comb(n - 1, i - 1)) % MOD;

		ans = (ans - comb(pos[x][0]+n-pos[x][1], i - 1) + MOD) % MOD;

		cout << ans << endl;

	}

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <algorithm>

#include <vector>

using namespace std;

typedef long long LL;

const LL MOD = 1000000007LL;

bool b[100001] = { false };

int num[100001];

LL fact[100001];

LL inv[100001];

LL inv_fact[100001];

LL mod_pow(LL x, LL a) {

	if (a == 0) return 1;

	if (a % 2 == 0) {

		LL ret = mod_pow(x, a / 2);

		return (ret*ret) % MOD;

	}

	else {

		return (x*mod_pow(x, a - 1)) % MOD;

	}

}

LL comb(LL n, LL k) {

	if (n < k) return 0;

	LL ans = (fact[n] * inv_fact[k]) % MOD;

	ans = (ans*inv_fact[n - k]) % MOD;

	return ans;

}

int main() {

	int n, dup[2];

	cin >> n;

	for (int i = 0; i <= n; i++) {

		int a;

		cin >> a;

		num[i] = a;

		if (!b[a - 1])b[a - 1] = true;

		else {

			dup[1] = i;

			break;

		}

	}

	for (int i = 0; i < dup[1]; i++) {

		if (num[i] == num[dup[1]])dup[0] = i;

	}

	fact[0] = 1;

	inv_fact[0] = 1;

	for (int i = 1; i < n + 1; i++) {

		inv[i] = mod_pow(i, MOD - 2);

		fact[i] = (fact[i - 1] * i) % MOD;

		inv_fact[i] = (inv_fact[i - 1] * inv[i]) % MOD;

	}

	int cen = dup[1] - dup[0] - 1;

	cout << n << endl;

	for (int i = 2; i <= n + 1; i++) {

		LL sum = 0;

		sum = (sum + comb(n - 1, i)) % MOD;

		sum = (sum + comb(n - 1, i - 2)) % MOD;

		sum = (sum + 2 * comb(n - 1, i - 1)) % MOD;

		sum = (sum - comb(n - cen - 1, i - 1) + MOD) % MOD;

		cout << sum << endl;

	}

}

// Fastest known solution for this problem: