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>
class IsIterable__ {
  static void f(...);
  template <class U>
  static typename U::const_iterator f(const U &);

 public:
  const static bool value =
      !std::is_same<void, decltype(f(std::declval<T>()))>::value;
};
template <class F, class S>
ostream &operator<<(ostream &o, const pair<F, S> &p) {
  return o << "(" << p.first << ", " << p.second << ")";
}
template <class C>
void O__(ostream &o, const C &c) {
  bool f = 1;
  for (const auto &x : c) {
    if (!f) {
      o << ", ";
    }
    if (IsIterable__<decltype(x)>::value) {
      o << "\n";
    }
    f = 0;
    o << x;
  }
}
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "[";
  O__(o, v);
  o << "]";
  return o;
}
template <class T, class V>
ostream &operator<<(ostream &o, const map<T, V> &v) {
  o << "{";
  O__(o, v);
  o << "}";
  return o;
}
template <class T>
ostream &operator<<(ostream &o, const set<T> &v) {
  o << "{";
  O__(o, v);
  o << "}";
  return o;
}
const double PI = 3.1415926535897932384626433832795;
const double EPS = 1e-9;
const int INF = std::numeric_limits<int>::max();
const long long LLINF = std::numeric_limits<long long>::max();
const int mod = 1000 * 1000 * 1000 + 7;
int mul(int x, int y) { return static_cast<int>((1LL * x * y) % mod); }
int add(int x, int y) { return (x + y) % mod; }
int mod_pow(int x, int n) {
  assert(n >= 0);
  int r = 1;
  while (n > 0) {
    if ((n & 1) != 0) {
      r = mul(r, x);
      --n;
    } else {
      x = mul(x, x);
      n /= 2;
    }
  }
  return r;
}
int inv(int x) {
  int i = mod_pow(x, mod - 2);
  assert(mul(i, x) == 1);
  return i;
}
int geom_sum(int r, int n) {
  return mul(add(mod - 1, mod_pow(r, n)), inv(add(mod - 1, r)));
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int r = mul(25, inv(26));
  int q;
  cin >> q;
  string s;
  cin >> s;
  int n = static_cast<int>(s.size());
  vector<pair<int, int> > req;
  map<int, vector<int> > req_given_n;
  while (q-- > 0) {
    int t;
    cin >> t;
    if (t == 1) {
      cin >> s;
      n = static_cast<int>(s.size());
    } else {
      int m;
      cin >> m;
      req.emplace_back(n, m);
      req_given_n[n].push_back((int)(req.size()) - 1);
    }
  }
  vector<int> p26;
  vector<int> p_r;
  vector<int> f;
  vector<int> ifa;
  for (int i = 0; i < 100 * 1000 + 100; ++i) {
    if (i == 0) {
      p26.push_back(1);
      p_r.push_back(1);
      f.push_back(1);
      ifa.push_back(1);
    } else {
      p26.push_back(mul(26, p26.back()));
      p_r.push_back(mul(r, p_r.back()));
      f.push_back(mul(i, f.back()));
      ifa.push_back(inv(f.back()));
    }
  }
  vector<int> ans(req.size(), -1);
  for (auto kv : req_given_n) {
    vector<pair<int, int> > m_seq;
    int n = kv.first;
    for (int i : kv.second) {
      int m = req[i].second;
      m_seq.emplace_back(m, i);
    }
    sort((m_seq).begin(), (m_seq).end());
    int j = 0;
    while (j < (int)m_seq.size() && m_seq[j].first < n) {
      int index = m_seq[j].second;
      ans[index] = 0;
      ++j;
    }
    int cur = 1;
    for (int M = n; M <= 100 * 1000; ++M) {
      while (j < (int)m_seq.size() && m_seq[j].first == M) {
        int index = m_seq[j].second;
        ans[index] = cur;
        ++j;
      }
      if (j == (int)m_seq.size()) {
        break;
      }
      ++M;
      cur = mul(cur, 26);
      cur =
          add(cur,
              mul(p26[M - n],
                  mul(p_r[M - n], mul(f[M - 1], mul(ifa[n - 1], ifa[M - n])))));
      --M;
    }
  }
  for (int x : ans) {
    cout << x << "\n";
  }
  return 0;
}