#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <functional>
#include <complex>
#include <queue>
#include <stack>
#include <cmath>
#include <cassert>
#include <tuple>
using namespace std;
typedef long long LL;
typedef complex<double> CMP;
static const unsigned MODVAL = 1000000007;
struct mint
{
unsigned val;
mint() :val(0) {}
mint(int x) :val(x%MODVAL) {}
mint(unsigned x) :val(x%MODVAL) {}
mint(LL x) :val(x%MODVAL) {}
};
mint& operator+=(mint& x, mint y) { return x = x.val + y.val; }
mint& operator-=(mint& x, mint y) { return x = x.val - y.val + MODVAL; }
mint& operator*=(mint& x, mint y) { return x = LL(x.val)*y.val; }
mint operator+(mint x, mint y) { return x += y; }
mint operator-(mint x, mint y) { return x -= y; }
mint operator*(mint x, mint y) { return x *= y; }
mint POW(mint x, LL e) { mint v = 1; for (; e; x *= x, e >>= 1) if (e & 1) v *= x; return v; }
mint& operator/=(mint& x, mint y) { return x *= POW(y, MODVAL - 2); }
mint operator/(mint x, mint y) { return x /= y; }
vector<mint> FAC_(1, 1);
mint FAC(LL n) { while (FAC_.size() <= n) FAC_.push_back(FAC_.back()*LL(FAC_.size())); return FAC_[n]; }
// nCk :: O(log MODVAL) time, O(n) space.
mint C(LL n, LL k) { return k<0 || n<k ? 0 : FAC(n) / (FAC(k) * FAC(n - k)); }
class AnnoyingPasswords { public:
int count(int U, int L, int D)
{
return (solve(-1,U,L,D) * FAC(26) / FAC(26 - U) * FAC(26) / FAC(26 - L) * FAC(10) / FAC(10 - D)).val;
}
int solve(int p, int U, int L, int D) {
tuple<int, int, int, int> key(p, U, L, D);
if (memo.count(key))
return memo[key];
if (U == 0 && L == 0 && D == 0)
return 1;
mint ans = 0;
if (p != 0 && U != 0)
ans += solve(0, U - 1, L, D);
if (p != 1 && L != 0)
ans += solve(1, U, L - 1, D);
if (p != 2 && D != 0)
ans += solve(2, U, L, D - 1);
return memo[key] = ans.val;
}
map<tuple<int, int, int, int>, int> memo;
};
// BEGIN CUT HERE
#include <ctime>
double start_time; string timer()
{ ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v)
{ os << "{ ";
for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it)
os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; }
void verify_case(const int& Expected, const int& Received) {
bool ok = (Expected == Received);
if(ok) cerr << "PASSED" << timer() << endl; else { cerr << "FAILED" << timer() << endl;
cerr << "\to: \"" << Expected << '\"' << endl << "\tx: \"" << Received << '\"' << endl; } }
#define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock();
#define END verify_case(_, AnnoyingPasswords().count(U, L, D));}
int main(){
CASE(0)
int U = 4;
int L = 1;
int D = 1;
int _ = 0;
END
CASE(1)
int U = 5;
int L = 0;
int D = 4;
int _ = 783743727;
END
CASE(2)
int U = 1;
int L = 1;
int D = 1;
int _ = 40560;
END
CASE(3)
int U = 2;
int L = 2;
int D = 3;
int _ = 559599923;
END
CASE(4)
int U = 0;
int L = 0;
int D = 0;
int _ = 1;
END
CASE(5)
int U = 26;
int L = 26;
int D = 10;
int _ = 0;
END
CASE(6)
int U = 0;
int L = 0;
int D = 0;
int _ = 1;
END
}
// END CUT HERE