use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let grid: Vec> = (0..n) .map(|_| (0..n).map(|_| itr.next().unwrap()).collect()) .collect(); let mut ans = 0; for j in 0..n { let mut ok = true; for i in 0..n { if i == j { continue; } if grid[i][j] != "nyanpass" { ok = false; } } if ok { if ans != 0 { println!("-1",); return; } else { ans = j + 1; } } } if ans == 0 { println!("-1",) } else { println!("{}", ans) } }