N = int(input())
lines = []
truelines = []
multy=1
i=-1
for q in range(0, N):
lines.append(int(input()))
for line in lines:
i+=1
if line % 2 == 1:
newlines = lines[i+6:]
for newline in newlines:
if newline % 2 == 1:
multy=newline*line
truelines.append(multy)
print(min(truelines) if truelines else -1)
TiA9IGludChpbnB1dCgpKQpsaW5lcyA9IFtdCnRydWVsaW5lcyA9IFtdCm11bHR5PTEKaT0tMQpmb3IgcSBpbiByYW5nZSgwLCBOKToKICAgIGxpbmVzLmFwcGVuZChpbnQoaW5wdXQoKSkpCmZvciBsaW5lIGluIGxpbmVzOgogICAgaSs9MQogICAgaWYgbGluZSAlIDIgPT0gMToKICAgICAgICBuZXdsaW5lcyA9IGxpbmVzW2krNjpdCiAgICAgICAgZm9yIG5ld2xpbmUgaW4gbmV3bGluZXM6CiAgICAgICAgICAgIGlmIG5ld2xpbmUgJSAyID09IDE6CiAgICAgICAgICAgICAgICBtdWx0eT1uZXdsaW5lKmxpbmUKICAgICAgICAgICAgICAgIHRydWVsaW5lcy5hcHBlbmQobXVsdHkpCnByaW50KG1pbih0cnVlbGluZXMpIGlmIHRydWVsaW5lcyBlbHNlIC0xKQo=