import java.util.*;
public class Main {
public static void main (String args[]) {
Scanner s = new Scanner(System.in);
int len = s.nextInt();
int nums[] = new int[len];
int count0 = 0;
int product = 1;
for(int i = 0; i < len; i++){
nums[i] = s.nextInt();
if (nums[i] == 0) {
count0++;
} else {
product = product * nums[i];
}
}
if(count0 == 0) {
for(int ele: nums){
int x = product/ele;
System.out.print(x + " ");
}
} else if (count0 == 1) {
for(int ele: nums){
if(ele == 0){
System.out.print(product + " ");
} else {
System.out.print("0 ");
}
}
} else {
for(int i=0; i < len; i++){
System.out.print("0 ");
}
}
}
}