functionisEN(c) { return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'; }
functionfindLongestABA(L) { const n = L.length; let res = 0; for(let i = 0; i < 2 * n - 1; i++) { let left = Math.floor(i / 2); let right = left + i % 2; let temp = left === right ? -1 : 0; let hasEN = isEN(L[i]); while(left >= 0 && right < n && L[left] === L[right]) { hasEN = hasEN || isEN(L[left]); left--; right++; temp+=2; } res = temp > res && hasEN ? temp : res; if (res === n) { break; } } return res < 3 ? 0 : res; }
process.stdin.on('readable', function() { var chunk = process.stdin.read(); if (chunk) buf += chunk.toString(); });