#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;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KCiNkZWZpbmUgTExVIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIHBpIDMuMTQxNTkyCiNkZWZpbmUgbmwgcHJpbnRmKCJcbiIpCiNkZWZpbmUgZihpLGwxLGwyKSBmb3IoaT1sMTtpPGwyO2krKykKI2RlZmluZSBnYyBnZXRjaGFyX3VubG9ja2VkCiNkZWZpbmUgdmkgdmVjdG9yPGludD4KI2RlZmluZSB2aXQgdmk6O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KzVdOwogICAgZihpLDAsbikKICAgICAgICB7CiAgICAgICAgICAgIGNpbj4+YVtpXTsKICAgICAgICAgICAgY1tpXSA9IGFbaV07CiAgICAgICAgfQogICAgc29ydChhLGErbik7CiAgICBtYXA8aW50LGludD4gaDsKICAgIGYoaSwwLG4pCiAgICB7CiAgICAgICAgaWYoaC5maW5kKGFbaV0pPT1oLmVuZCgpKXsKICAgICAgICBmKGosaSsxLG4pCiAgICAgICAgewogICAgICAgICAgICBpZihhW2pdJWFbaV09PTApCiAgICAgICAgICAgICAgICBoW2FbaV1dKz0xOwogICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICBsbCBhbnMgPSAwOwogICAgZihpLDAsbikKICAgIHsKICAgICAgICBpbnQgeCA9IGhbY1tpXV07CiAgICAgICAgLy9jb3V0PDx4OwogICAgICAgIGFucyA9IG1vZF9wb3coMix4KzEpOwogICAgICAgIGFucyU9bW9kOwogICAgICAgIGFucyA9IChhbnMtMSttb2QpJW1vZDsKICAgICAgICBjb3V0PDxhbnM8PCIgIjsKICAgIH0KCiAgICByZXR1cm4gMDsKfQoK