#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,a,n) for(int i=a;i<(n);i++) #define rrep(i,n) for(int i=(n)-1;i>=0;i--) #define VI vector #define VS vector #define all(a) (a).begin(),(a).end() #define debug(x) cout<<#x<<": "< P; typedef long long ll; const int INF=1000000; char fi[101][101]; int d[21][21]; int day[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int N,M; int sx,sy; int gx,gy; int w,h; int ans; int dx[4]={0,0,-1,1}; int dy[4]={-1,1,0,0}; const int MAX_V=100; const int MAX_N=100; char o[3]={'+','-','*'}; #define md 1000003 int dp[353][353]={0}; int bow[353][353]={0}; int main(){ int n; cin>>n; int k=n; vector p(n); rep(i,n) p[i]=true; rep(i,n){ string s; rep(j,n){ cin>>s; if(s!="-"&&s!="nyanpass"&&p[j]){ p[j]=false; k--; } } } if(k!=1) cout<<-1<