import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; void main() { auto n = readln.chomp.to!size_t; auto aij = iota(n).map!(_ => readln.split.array).array; size_t[] r; foreach (i; 0..n) { auto ai = aij.map!(ai => ai[i]).array; if ((ai[0..i] ~ ai[i+1..n]).all!(a => a == "nyanpass")) r ~= i; } if (r.length == 1) writeln(r.front + 1); else writeln(-1); }