let input = require('fs').readFileSync('/dev/stdin', 'utf8'); let A = input.split('\n'); A.pop(); A = A.map(v => v.split(/\s/)) .filter((v, i) => i != 0); const t = arr => arr.map((col, i) => arr.map(row => row[i])); const COUNT = t(A) .map((v, i) => v.includes('nyanpass') && [...new Set(v)].length == 2 && i + 1) .filter(v => v); console.log(COUNT.length == 1 ? COUNT[0] : -1);