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 C>
void mini(C& a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C& a4, C b4) {
  a4 = max(a4, b4);
}
template <class TH>
void _dbg(const char* sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char* sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  os << "[";
  for (auto& tt : V) {
    os << tt << ",";
  }
  os << "]";
  return os;
}
long long m = 0;
long long res[100010], dp[100010];
vector<pair<long long, long long> > zap[100010];
long long dl() {
  string z;
  cin >> z;
  return ((long long)(z).size());
}
const long long P = 1e9 + 7;
long long odw[100010];
long long pot(long long a, long long w) {
  long long r = 1;
  while (w) {
    if (w & 1) {
      r = r * a % P;
    }
    w /= 2;
    a = a * a % P;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  if (0) cout << fixed << setprecision(11);
  long long q;
  cin >> q;
  long long ak = dl();
  for (long long i = 0; i < q; i++) {
    long long co;
    cin >> co;
    if (co == 1) {
      ak = dl();
    } else {
      long long n;
      cin >> n;
      zap[ak].push_back({n, m++});
    }
  }
  for (long long i = 0; i < 100010; i++) odw[i] = pot(i, P - 2);
  (odw[1], odw[2]);
  for (long long dl = 0; dl < 100010; dl++) {
    if (((long long)(zap[dl]).size())) {
      for (long long i = 0; i < dl; i++) dp[i] = 0;
      long long pom = 1;
      long long sum = 0;
      for (long long i = dl; i < 100010; i++) {
        sum *= 26;
        sum += pom;
        sum %= P;
        dp[i] = sum;
        pom = (pom * 25) % P * i % P * odw[i - dl + 1] % P;
      }
      for (auto x : zap[dl]) {
        res[x.second] = dp[x.first];
      }
    }
  }
  for (long long i = 0; i < m; i++) {
    cout << res[i] << "\n";
  }
}