#include <stdio.h>

int main (void)
{
  double x,i;
  double s,sum;
  sum = 1;
  scanf("%lf", &x);
  for(i = 0; i < x; i++) {
    scanf("%lf",&s);
    printf("%lf ",s);
    sum *= s;
  }
  if(sum >= 1000000000000000000) {
    printf("-1\n");
    return 0;
  }
  printf("%.0lf\n",sum);
   return 0;
}