import std; void main() { int N; readf("%d\n", N); auto S = new string[](N); bool[string] isRegistered; foreach (i; 0 .. N) { S[i] = readln.chomp; isRegistered[S[i]] = true; } foreach (s; S) { int res; auto t = s.dup.to!(dchar[]); auto len = t.length; foreach (i; 0 .. len) { foreach (l; lowercase) { if (l == s[i]) continue; t[i] = l; if (t.to!string in isRegistered) ++res; } t[i] = s[i]; } res.writeln; } }