#include <stdio.h>

int main(void)
{
	int unsigned long long a = 1;
	int n;
	int unsigned long long array[100000] = {};

	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		scanf("%llu", &array[i]);
	}

	for (int i = 0; i < n; i++)
	{
		a = a * array[i];
		if (a <= 1000000000000000000)
		{
			printf("%lld", a);
		}
		else
		{
			printf("-1");
		}
	}
	return 0;
}
