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;
long long int mypow(long long int a, long long int n) {
  long long int ans = 1, now = a;
  while (n) {
    if (n & 1) {
      ans *= now;
      ans %= (1000000007);
    }
    now *= now;
    now %= (1000000007);
    n >>= 1;
  }
  return ans;
}
int p[400][400];
long long int pow25[100010];
struct Reverse {
  long long int reverse(long long int a) { return mypow(a, (1000000007) - 2); }
} r1;
struct Cn {
  long long int p[100010];
  long long int revp[100010];
  long long int ans[100010];
  int n;
  void init(int nn, Reverse* r) {
    n = nn;
    int i;
    p[0] = revp[0] = 1;
    for (i = 1; i <= n; i++) {
      p[i] = (p[i - 1] * i) % (1000000007);
      revp[i] = r->reverse(p[i]);
    }
    for (i = 0; i <= n; i++) {
      ans[i] = CC(i);
    }
  }
  long long int CC(int a) {
    long long int ans = p[n];
    ans *= revp[a];
    ans %= (1000000007);
    ans *= revp[n - a];
    ans %= (1000000007);
    return ans;
  }
  long long int Cij(int i, int j) {
    if (i > j) return 0;
    long long int ans = p[j];
    ans *= revp[i];
    ans %= (1000000007);
    ans *= revp[j - i];
    ans %= (1000000007);
    return ans;
  }
  long long int C(int a) { return ans[a]; }
} cn;
char s[100010];
int i, j, n, m;
long long int F(int i, int j) {
  if (i < 0 || j < 0) return 0;
  if (i == j) return 1;
  if (j < n) {
    return mypow(25, i - j) * cn.Cij(j, i) % 1000000007;
  } else {
    return (F(i - 1, j - 1) + 26 * F(i - 1, j)) % (1000000007);
  }
}
int Q(int i, int j) {
  long long int ans = (long long int)pow25[i - j] * cn.Cij(j, i) % (1000000007);
  return (int)ans;
}
void prepare() {
  p[0][0] = 1;
  for (i = 1, j = 300; j < 100010; i++, j += 300) {
    p[i][0] = mypow(26, j);
  }
  for (i = 1; i * 300 < 100010; i++) {
    for (j = 1; j <= i; j++) {
      int last = (j - 1) * 300;
      int now = p[i][j - 1], lastnow = 0;
      for (int k = 0; k < 300; k++) {
        n = last + 1;
        lastnow = now;
        now = (lastnow - Q(i * 300, last) + (1000000007));
        if (now >= (1000000007)) now -= (1000000007);
        last++;
      }
      p[i][j] = now;
    }
  }
}
int FF(int i, int j) {
  if (i < j) return 0;
  if (i % 300 == 0 && j % 300 == 0) {
    return p[i / 300][j / 300];
  }
  if (j % 300) {
    int temp = FF(i, j - 1);
    temp = temp - Q(i, j - 1) + (1000000007);
    if (temp >= (1000000007)) temp -= (1000000007);
    return temp;
  } else {
    long long int temp = FF(i - 1, j);
    temp *= 26;
    if (j && i) temp += Q(i - 1, j - 1);
    return temp % (1000000007);
  }
}
int main() {
  cn.init(100010 - 1, &r1);
  int nn;
  scanf("%d", &nn);
  scanf("%s", s);
  int a;
  pow25[0] = 1;
  for (i = 1; i < 100010; i++) {
    pow25[i] = pow25[i - 1] * 25 % (1000000007);
  }
  prepare();
  n = strlen(s);
  while (nn--) {
    scanf("%d", &a);
    if (a == 1) {
      scanf("%s", s);
      n = strlen(s);
    } else {
      scanf("%d", &m);
      if (m < n) {
        printf("%d\n", 0);
        continue;
      }
      if (m == n) {
        printf("%d\n", 1);
        continue;
      }
      printf("%d\n", (int)FF(m, n));
    }
  }
  return 0;
}