#include<stdio.h>
#include<math.h>

int N;
long long ans=1;
int main()
{
scanf("%d",&N);

long long a[N]; 

for (int i = 0; i < N; i++)
{
  scanf("%lld",&a[i]);
  ans *= a[i];
  printf("[%d] %lld\n",i,ans);
  
}
  if(ans > (long)pow(10,18))
  {

    ans = -1;
  }

printf("%lld",ans);



return 0;

}