using
System;
using
System.Collections.Generic;
class
Program
{
const
int
MOD = 1000000007;
static
int
N, K;
static
List<List<List<
int
>>> memo;
static
int
CountWays(
int
pos,
int
vowels,
bool
prevVowel)
{
if
(pos == N)
return
1;
if
(memo[pos][vowels][prevVowel ? 1 : 0] != -1)
return
memo[pos][vowels][prevVowel ? 1 : 0];
int
res = 0;
res = (res + 21 * CountWays(pos + 1, 0,
false
)) % MOD;
if
(prevVowel && vowels == K)
{
res = (res + 0) % MOD;
}
else
{
res = (res + 5 * CountWays(pos + 1, prevVowel ? vowels + 1 : 1,
true
)) % MOD;
}
return
memo[pos][vowels][prevVowel ? 1 : 0] = res;
}
static
int
Kvowelwords(
int
n,
int
k)
{
N = n; K = k;
memo =
new
List<List<List<
int
>>>(N);
for
(
int
i = 0; i < N; i++)
{
memo.Add(
new
List<List<
int
>>(K + 1));
for
(
int
j = 0; j <= K; j++)
{
memo[i].Add(
new
List<
int
> { -1, -1 });
}
}
return
CountWays(0, 0,
false
);
}
static
void
Main(
string
[] args)
{
Console.WriteLine(Kvowelwords(3, 3));
}
}