Problem: The famous sculptor Cicasso is a Reberlandian spy!

These is breaking news in Berlandian papers today. And now the sculptor is hiding. This time you give the shelter to the maestro. You have a protected bunker and you provide it to your friend. You set the security system in such way that only you can open the bunker. To open it one should solve the problem which is hard for others but is simple for you.

Every day the bunker generates a codeword s. Every time someone wants to enter the bunker, integer n appears on the screen. As the answer one should enter another integer — the residue modulo 109 + 7 of the number of strings of length n that consist only of lowercase English letters and contain the string s as the subsequence.

The subsequence of string a is a string b that can be derived from the string a by removing some symbols from it (maybe none or all of them). In particular any string is the subsequence of itself. For example, the string "cfo" is the subsequence of the string "codeforces".

You haven't implemented the algorithm that calculates the correct answers yet and you should do that ASAP.

Input

The first line contains integer m (1 ≤ m ≤ 105) — the number of the events in the test case.

The second line contains nonempty string s — the string generated by the bunker for the current day.

The next m lines contain the description of the events. The description starts from integer t — the type of the event.

If t = 1 consider a new day has come and now a new string s is used. In that case the same line contains a new value of the string s.

If t = 2 integer n is given (1 ≤ n ≤ 105). This event means that it's needed to find the answer for the current string s and the value n.

The sum of lengths of all generated strings doesn't exceed 105. All of the given strings consist only of lowercase English letters.

Output

For each query of the type 2 print the answer modulo 109 + 7 on the separate line.

Example

Input

3
a
2 2
1 bc
2 5


Output

51
162626

Note

In the first event words of the form "a?" and "?a" are counted, where ? is an arbitrary symbol. There are 26 words of each of these types, but the word "aa" satisfies both patterns, so the answer is 51.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7, inv26 = 576923081;
long long n, jc[100005], inv[100005], pow25[100005], pow26[100005],
    inv1[100005], tot, ans[100005];
struct node {
  long long id, val;
  bool operator<(const node &a) const { return val < a.val; }
} q[100005];
string s;
long long read() {
  long long f = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    f = f * 10 + ch - '0';
    ch = getchar();
  }
  return f * w;
}
long long calc(long long x, long long y) {
  if (x < y) return 0;
  return jc[x] * inv[y] % mod * inv[x - y] % mod;
}
long long qpow(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
void init() {
  pow25[0] = pow26[0] = jc[0] = inv[0] = inv1[0] = 1;
  for (long long i = 1; i <= 100000; i++) {
    pow25[i] = pow25[i - 1] * 25 % mod;
    pow26[i] = pow26[i - 1] * 26 % mod;
    inv1[i] = inv1[i - 1] * inv26 % mod;
    jc[i] = jc[i - 1] * i % mod;
  }
  inv[100000] = qpow(jc[100000], mod - 2);
  for (long long i = 99999; i >= 1; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
}
void solve() {
  long long l = s.size(), now = l;
  sort(q + 1, q + 1 + tot);
  for (long long i = 1; i <= tot; i++) {
    ans[q[i].id] = 0;
    for (; now <= q[i].val; now++) {
      ans[q[i].id] = (ans[q[i].id] + calc(now - 1, l - 1) * pow25[now - l] %
                                         mod * inv1[now] % mod) %
                     mod;
    }
    ans[q[i].id] = (ans[q[i].id] + ans[q[i - 1].id]) % mod;
  }
  for (long long i = 1; i <= tot; i++)
    ans[q[i].id] = ans[q[i].id] * pow26[q[i].val] % mod;
  for (long long i = 1; i <= tot; i++) printf("%lld\n", ans[i]);
  tot = 0;
}
signed main() {
  n = read();
  init();
  cin >> s;
  for (long long i = 1; i <= n; i++) {
    long long opt = read(), x;
    if (opt == 1) {
      solve();
      cin >> s;
    } else {
      x = read();
      tot++;
      q[tot] = (node){tot, x};
    }
  }
  solve();
  return 0;
}