#include using namespace std; #define F first #define S second #define R cin>> #define Z class #define ll long long #define ln cout<<'\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) printf("%.10f\n",a) #define mem(a) memset(a,0,sizeof(a)) #define all(c) (c).begin(),(c).end() #define iter(c) __typeof((c).begin()) #define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--) #define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define rep(i,n) REP(i,0,n) #define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++) templatevoid pr(A a){cout<void pr(A a,B b){cout<void pr(A a,B b,C c){cout<void pr(A a,B b,C c,D d){cout<void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<=0&&x=0&&y P; int d[26][2111][2111]; void init(int n,int m) { rep(k,26) { rep(i,n+1)rep(j,m) d[k][i][j+1]+=d[k][i][j]; rep(j,m+1)rep(i,n) d[k][i+1][j]+=d[k][i][j]; } } int calc(int x1,int y1,int x2,int y2,int k) {return d[k][x2][y2]-d[k][x1][y2]-d[k][x2][y1]+d[k][x1][y1];} void Main() { int n,m,t; cin >> n >> m >> t; string s[n]; rep(i,n) cin >> s[i]; rep(i,n)rep(j,m) d[s[i][j]-'a'][i+1][j+1]++; init(n,m); int ans=0; rep(i,n) { rep(j,m) { int l=0,r=min(n-i,m-j)+1; while(l+1