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>
#pragma comment(linker, "/STACK:667772160")
using namespace std;
struct __isoff {
  __isoff() {
    if (0) freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
    srand('C' + 'T' + 'A' + 'C' + 'Y' + 'M' + 'B' + 'A');
    srand(time(0));
  }
  ~__isoff() {}
} __osafwf;
const unsigned long long p1 = 123123;
const unsigned long long p2 = 12321;
const double eps = 1e-6;
const double pi = acos(-1.0);
const long long inf = 1e18 + 7;
const int infi = 2e9 + 7;
const long long dd = 3e5 + 7;
const long long maxN = 1e5 + 7;
const long long sh = 4501;
const long long mod = 1e9 + 7;
const long long mod2 = 100003;
long long Fact[dd], Ifac[dd], c25[dd], c26[dd], ic26[dd];
long long bp(long long x, int t) {
  if (t == 0) {
    return 1;
  }
  if (t % 2) {
    return bp(x, t - 1) * x % mod;
  }
  x = bp(x, t / 2);
  return x * x % mod;
}
vector<pair<int, int> > G;
map<int, int> Go;
long long cnk(int n, int m) {
  if (m > n || m < 0) {
    return 0;
  }
  return Fact[n] * Ifac[m] % mod * Ifac[n - m] % mod;
}
vector<vector<pair<int, int> > > T;
vector<int> Res;
int main() {
  Fact[0] = Ifac[0] = c25[0] = c26[0] = ic26[0] = 1;
  for (long long i = (long long)1; i < (long long)dd; i++) {
    Fact[i] = Fact[i - 1] * i % mod;
    Ifac[i] = Ifac[i - 1] * bp(i, mod - 2) % mod;
    c25[i] = c25[i - 1] * 25 % mod;
    c26[i] = c26[i - 1] * 26 % mod;
    ic26[i] = ic26[i - 1] * bp(26, mod - 2) % mod;
  }
  int n;
  string s;
  cin >> n >> s;
  vector<int> L;
  L.push_back(s.size());
  int f = 0;
  for (long long i = 0; i < (long long)n; i++) {
    int t;
    cin >> t;
    if (t == 2) {
      int g;
      cin >> g;
      f++;
      G.push_back(make_pair(s.size(), g));
    } else {
      cin >> s;
      L.push_back(s.size());
    }
  }
  Res.resize(f);
  sort(L.begin(), L.end());
  L.resize(unique(L.begin(), L.end()) - L.begin());
  for (long long i = 0; i < (long long)L.size(); i++) {
    Go[L[i]] = i;
  }
  T.resize(L.size());
  for (long long i = 0; i < (long long)G.size(); i++) {
    T[Go[G[i].first]].push_back(make_pair(G[i].second, i));
  }
  for (long long i = 0; i < (long long)L.size(); i++) {
    long long res = 0;
    int s = L[i];
    vector<long long> Z(maxN);
    for (long long j = (long long)1; j < (long long)maxN; j++) {
      if (j >= s) {
        res = (res + c25[j - s] * ic26[j] % mod * cnk(j - 1, s - 1)) % mod;
      }
      Z[j] = res;
    }
    for (long long j = 0; j < (long long)T[i].size(); j++) {
      Res[T[i][j].second] = Z[T[i][j].first] * c26[T[i][j].first] % mod;
    }
  }
  for (long long i = 0; i < (long long)f; i++) {
    cout << Res[i] << '\n';
  }
}