#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const int inf=1<<30; const ll INF=1LL<<62; typedef pair P; typedef pair PP; const ll MOD=998244353; const int MAXN=3*1000000; ll gcd(ll x,ll y){ if(x=y return y==0?x:gcd(y,x%y); } int main(){ int N; cin>>N; vector A(N); for(int i=0;i>A[i]; } vector ans(N+1); for(int i=0;i