#include <stdio.h>
int main(void){
	int n;
	scanf("%d",&n);
	unsigned long long int a[n],b;
	
	for(int p = 0; p < n+1; p++){
		scanf("%lld",&a[p]);
		if(a[p] == 0){
			printf("0");
			return(0);
		}
		
		b*=a[p];
		
		//if(b >1000000000000000000){
		//	printf("-1");
		//	return(0);
		//}
	}
	printf("%llx",b);
	return 0;
	}