#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n;
    cin>>n;
    vector<int> a(n);
    vector<int> pref(n+1);
    vector<int> sufiks(n+1);
    int i;
    pref[0]=1;
    sufiks[n]=1;
    for(i=0;i<n;i++){
        cin>>a[i];
        pref[i+1]=pref[i]*a[i];
    }
    for(i=n-1;i>=0;i--){
        sufiks[i]=sufiks[i+1]*a[i];
    }
    for(i=0;i<n;i++){
        cout<<(pref[i]*sufiks[i+1])<<" ";
    }
    cout<<endl;
    return 0;
}
