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 <typename TH>
void _dbg(const char* sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <typename TH, typename... TA>
void _dbg(const char* sdbg, TH h, TA... t) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, t...);
}
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 T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> pair) {
  return out << "(" << pair.first << ", " << pair.second << ")";
}
template <class A, class B, class C>
struct Triple {
  A first;
  B second;
  C third;
  bool operator<(const Triple& t) const {
    if (first != t.first) return first < t.first;
    if (second != t.second) return second < t.second;
    return third < t.third;
  }
};
template <class T>
void ResizeVec(T&, vector<long long>) {}
template <class T>
void ResizeVec(vector<T>& vec, vector<long long> sz) {
  vec.resize(sz[0]);
  sz.erase(sz.begin());
  if (sz.empty()) {
    return;
  }
  for (T& v : vec) {
    ResizeVec(v, sz);
  }
}
template <class A, class B, class C>
ostream& operator<<(ostream& out, Triple<A, B, C> t) {
  return out << "(" << t.first << ", " << t.second << ", " << t.third << ")";
}
template <class T>
ostream& operator<<(ostream& out, vector<T> vec) {
  out << "(";
  for (auto& v : vec) out << v << ", ";
  return out << ")";
}
struct FastNewton {
 private:
  long long P;
  long long range;
  vector<long long> inv;
  vector<long long> fact;
  vector<long long> fact_inv;
  vector<long long> v_p;

 public:
  FastNewton(long long _P, long long _range = 0) { init(_P, _range); }
  void init(long long _P, long long _range = -1) {
    P = _P;
    if (_range == -1) {
      range = P;
    } else {
      range = _range;
    }
    inv.resize(range + 5);
    fact.resize(range + 5);
    fact_inv.resize(range + 5);
    v_p.resize(range + 5);
    fact[0] = 1;
    fact_inv[0] = 1;
    inv[0] = -1;
    inv[1] = 1;
    for (long long i = 2; i < min(range, P); i++) {
      inv[i] = P - (P / i) * inv[P % i] % P;
    }
    for (long long i = 1; i <= range; i++) {
      long long tmp = i;
      while (tmp % P == 0) {
        tmp /= P;
      }
      fact[i] = tmp * fact[i - 1] % P;
      fact_inv[i] = fact_inv[i - 1] * inv[tmp] % P;
    }
    for (long long i = 1; i <= range; i++) {
      v_p[i] = i / P + v_p[i / P];
    }
  }
  long long get_inv(long long a) const {
    if (a % P == 0) {
      cout << "ERROR: 0 has not got its inverse\n";
      return -1;
    }
    return inv[a % P];
  }
  long long get_normal_fact(long long n) const {
    if (n >= P) {
      return 0;
    }
    return fact[n];
  }
  long long get_better_fact(long long n) const {
    if (n > range) {
      cout << "ERROR: n too large\n";
      return -1;
    }
    return fact[n];
  }
  long long get_v_p(long long n) const {
    if (n > range) {
      cout << "ERROR: n too large\n";
      return -1;
    }
    return v_p[n];
  }
  long long choose(long long n, long long k) const {
    if (k < 0 || k > n) {
      return 0;
    }
    if (v_p[n] == v_p[k] + v_p[n - k]) {
      return fact[n] * fact_inv[k] % P * fact_inv[n - k] % P;
    } else {
      return 0;
    }
  }
};
const long long P = 1e9 + 7;
const long long N = 1e5 + 5;
long long p25[N];
long long p26[N];
long long res[N];
map<long long, vector<pair<long long, long long>>> zap;
long long spow(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b % 2) {
      r = a * r % P;
    }
    a = a * a % P;
    b /= 2;
  }
  return r;
}
long long Inv(long long a) { return spow(a, P - 2); }
long long val[N];
int main() {
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  if (0) cout << fixed << setprecision(10);
  cin.tie(0);
  FastNewton newt(P, 2 * N);
  p25[0] = 1;
  p26[0] = 1;
  for (long long i = (1); i <= (N - 1); ++i) {
    p25[i] = p25[i - 1] * 25 % P;
    p26[i] = p26[i - 1] * 26 % P;
  }
  long long m;
  cin >> m;
  string s;
  cin >> s;
  long long q = 0;
  long long c = 25 * Inv(26) % P;
  long long len = ((long long)(s).size());
  for (long long i = (1); i <= (m); ++i) {
    long long type;
    cin >> type;
    if (type == 1) {
      cin >> s;
      len = ((long long)(s).size());
    } else {
      long long n;
      cin >> n;
      q++;
      zap[len].push_back({n, q});
    }
  }
  for (auto p : zap) {
    long long s1 = p.first;
    vector<pair<long long, long long>> v = p.second;
    (s1);
    (v);
    long long cp = 1;
    for (long long i = 0; i < (N); ++i) {
      val[i] = 0;
      if (i) {
        val[i] += val[i - 1];
      }
      val[i] += newt.choose(i + s1 - 1, s1 - 1) * cp;
      val[i] %= P;
      cp = cp * c % P;
    }
    for (auto parka : v) {
      if (parka.first < s1) {
        res[parka.second] = 0;
      } else {
        res[parka.second] =
            val[parka.first - s1] * spow(26, parka.first - s1) % P;
      }
    }
  }
  for (long long i = (1); i <= (q); ++i) {
    cout << res[i] << "\n";
  }
  return 0;
}