#include<bits/stdc++.h>

#define LLU unsigned long long
#define ll long long
#define pi 3.141592
#define nl printf("\n")
#define f(i,l1,l2) for(i=l1;i<l2;i++)
#define gc getchar_unlocked
#define vi vector<int>
#define vit vi::iterator
#define all(c) c.begin(), c.end()
#define pb push_back
#define endl "\n"
#define mp make_pair
#define mod 1000000007
using namespace std;

/*void fin(int &x)       //does not compile in codeblocks but does in online judges
{                        //use if input too large ( only for integers )
int i=0;x=0;
register int c=gc();
while(c<48||c>57)
c=gc();
while(c>47&&c<58)
{
x=(x<<1)+(x<<3) + c-48;
i++;
c=gc();
}
}*/

ll gcd(ll m, ll n)
{
    if(n==0)
        return m;
    return gcd(n,m%n);
}

LLU mod_pow(LLU base, LLU exp)
{
    LLU res=1;
    while (exp>0)
    {
        if (exp%2==1)
            res=(res*base)%mod;
        exp=exp>>1;
        base =(base*base)%mod;
    }
    return res;
}

int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    int t,i,j,n,e;
    cin>>n;
    int a[n+5];
    int c[n+5];
    f(i,0,n)
        {
            cin>>a[i];
            c[i] = a[i];
        }
    sort(a,a+n);
    map<int,int> h;
    f(i,0,n)
    {
        if(h.find(a[i])==h.end()){
        f(j,i+1,n)
        {
            if(a[j]%a[i]==0)
                h[a[i]]+=1;
        }
        }
    }
    ll ans = 0;
    f(i,0,n)
    {
        int x = h[c[i]];
        //cout<<x;
        ans = mod_pow(2,x+1);
        ans%=mod;
        ans = (ans-1+mod)%mod;
        cout<<ans<<" ";
    }

    return 0;
}

