#include #include #include #include #include #include #include #include #define vv(a, b, c, d) vector >(a, vector(b, c)) #define vvi vector > #define vvl vector > #define vvv(a, b, c, d, e) vector > >(a, vector >(b, vector (c, d))) #define vvvl vector > > #define MODs 1000000007; typedef long long int ll; using namespace std; int main(int argc, char const *argv[]) { ll H, W, K; std::cin >> H >> W >> K; std::vector c(H); for(int i=0;i> c[i]; vvvl dp = vvv(H, W, 26, 0, ll); for(int i=0;i<26;i++){ dp[H-1][W-1][i] = (c[H-1][W-1]-'a'==i?1:-1); for(int j=0;j las(26); for(int i=0;i