#include <stdio.h>
int main(void){

	int a;
	_int64 b;
	int n,i;


	scanf("%d", &a);
	for (n = 0; n < 0; n++) {
		for (i = 0; i < a; i++) {
			scanf("%d", &b);
			b *= b;
		}
		if (b <= 1000000000000000000) {


			printf("%d", b);

		}

		else if (b > 10000000000000000) {
			printf("-1");
		}
	}
	return 0;
}