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;
template <class T>
inline void in(T &x) {
  x = 0;
  short f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + (c ^ '0'), c = getchar();
  x *= f;
}
template <class T>
inline void out(T x, const char c = '\n') {
  static short st[30];
  short m = 0;
  if (x < 0) putchar('-'), x = -x;
  do st[++m] = x % 10, x /= 10;
  while (x);
  while (m) putchar(st[m--] | '0');
  putchar(c);
}
template <class T, class... Args>
inline void in(T &x, Args &...args) {
  in(x);
  in(args...);
}
template <class T, class... Args>
inline void out(const T &x, const Args &...args) {
  out(x, ' ');
  out(args...);
}
template <class T>
inline void prt(T a[], int n) {
  for (register int i = 0; i < n; ++i) out(a[i], ' ');
  putchar('\n');
}
template <class T>
inline void clr(T a[], int n) {
  memset(a, 0, sizeof(T) * n);
}
template <class T>
inline void clr(T *a, T *b) {
  memset(a, 0, sizeof(T) * (b - a));
}
template <class T>
inline bool ckmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
inline bool ckmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
namespace MOD_CALC {
const int md = 1e9 + 7;
inline int add(const int a, const int b) {
  return a + b >= md ? a + b - md : a + b;
}
inline int sub(const int a, const int b) {
  return a - b < 0 ? a - b + md : a - b;
}
inline int mul(const int a, const int b) { return (long long)a * b % md; }
inline void inc(int &a, const int b) { (a += b) >= md ? a -= md : 0; }
inline void dec(int &a, const int b) { (a -= b) < 0 ? a += md : 0; }
inline int qpow(int a, int b) {
  int r = 1;
  for (; b; b >>= 1, a = mul(a, a))
    if (b & 1) r = mul(r, a);
  return r;
}
inline int mdinv(const int a) { return qpow(a, md - 2); }
}  // namespace MOD_CALC
using namespace MOD_CALC;
namespace i207M {
const int Max = 1e5;
int fac[100005], ifac[100005];
int pw25[100005], pw26[100005], ipw26[100005];
void prework(int n) {
  fac[0] = 1;
  for (register int i = 1; i <= n; ++i) fac[i] = mul(fac[i - 1], i);
  ifac[n] = mdinv(fac[n]);
  for (register int i = n; i >= 1; --i) ifac[i - 1] = mul(ifac[i], i);
  pw25[0] = 1;
  for (register int i = 1; i <= n; ++i) pw25[i] = mul(pw25[i - 1], 25);
  pw26[0] = 1;
  for (register int i = 1; i <= n; ++i) pw26[i] = mul(pw26[i - 1], 26);
  ipw26[0] = 1;
  int i26 = mdinv(26);
  for (register int i = 1; i <= n; ++i) ipw26[i] = mul(ipw26[i - 1], i26);
}
void work(vector<int> &a, int m) {
  a.resize(Max + 1);
  for (register int i = m; i <= Max; ++i)
    a[i] = add(a[i - 1],
               mul(mul(fac[i - 1], ipw26[i]), mul(pw25[i - m], ifac[i - m])));
}
int n, m;
map<int, vector<int>> rem;
inline int calc(int n, int m) {
  if (n < m) return 0;
  int ans = mul(rem[m][n], mul(pw26[n], ifac[m - 1]));
  return ans;
}
signed main() {
  prework(Max);
  int cq, len, op, v;
  in(cq);
  static char s[100005];
  scanf("%s", s);
  len = strlen(s);
  work(rem[len], len);
  while (cq--) {
    in(op);
    if (op == 1) {
      scanf("%s", s), len = strlen(s);
      if (!rem.count(len)) work(rem[len], len);
    } else {
      in(v);
      out(calc(v, len));
    }
  }
  return 0;
}
}  // namespace i207M
signed main() {
  i207M::main();
  return 0;
}