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;
constexpr int MOD = 1000000007;
template <typename T>
std::istream& operator>>(std::istream& i, vector<T>& t) {
  for (auto& v : t) {
    i >> v;
  }
  return i;
}
template <typename T>
std::ostream& operator<<(std::ostream& o, const vector<T>& t) {
  for (size_t i = 0; i < t.size(); ++i) {
    o << t[i] << " \n"[i == t.size() - 1];
  }
  return o;
}
namespace std {
template <typename T, typename U>
struct hash<pair<T, U>> {
  hash<T> t;
  hash<U> u;
  size_t operator()(const pair<T, U>& p) const {
    return t(p.first) ^ (u(p.second) << 7);
  }
};
}  // namespace std
template <typename T, typename F>
T bsh(T l, T h, const F& f) {
  T r = -1, m;
  while (l <= h) {
    m = (l + h) / 2;
    if (f(m)) {
      l = m + 1;
      r = m;
    } else {
      h = m - 1;
    }
  }
  return r;
}
template <typename T, typename F>
T bsl(T l, T h, const F& f) {
  T r = -1, m;
  while (l <= h) {
    m = (l + h) / 2;
    if (f(m)) {
      h = m - 1;
      r = m;
    } else {
      l = m + 1;
    }
  }
  return r;
}
template <typename T>
T gcd(T a, T b) {
  if (a < b) swap(a, b);
  return b ? gcd(b, a % b) : a;
}
template <unsigned int N>
class Field {
  inline unsigned int inv(unsigned int a) {
    long long t = 0, nt = 1, r = N, nr = a;
    while (nr) {
      long long q = r / nr;
      t -= q * nt;
      swap(t, nt);
      r -= q * nr;
      swap(r, nr);
    }
    assert(r <= 1);
    return (t < 0) ? t + N : t;
  }

 public:
  inline Field(int first = 0) : v(first) {}
  inline Field<N>& operator+=(const Field<N>& o) {
    if ((long long)v + o.v >= N)
      v = (long long)v + o.v - N;
    else
      v = v + o.v;
    return *this;
  }
  inline Field<N>& operator-=(const Field<N>& o) {
    if (v < o.v)
      v = N - o.v + v;
    else
      v = v - o.v;
    return *this;
  }
  inline Field<N>& operator*=(const Field<N>& o) {
    v = (unsigned long long)v * o.v % N;
    return *this;
  }
  inline Field<N>& operator/=(const Field<N>& o) { return *this *= inv(o.v); }
  inline Field<N> operator+(const Field<N>& o) {
    Field<N> r{*this};
    return r += o;
  }
  inline Field<N> operator-(const Field<N>& o) {
    Field<N> r{*this};
    return r -= o;
  }
  inline Field<N> operator*(const Field<N>& o) {
    Field<N> r{*this};
    return r *= o;
  }
  inline Field<N> operator/(const Field<N>& o) {
    Field<N> r{*this};
    return r /= o;
  }
  inline Field<N> operator-() { return {-v}; };
  inline Field<N>& operator++() {
    ++v;
    if (v == N) v = 0;
    return *this;
  }
  inline Field<N> operator++(int) {
    Field<N> r{*this};
    ++*this;
    return r;
  }
  inline Field<N>& operator--() {
    --v;
    if (v == -1) v = N - 1;
    return *this;
  }
  inline Field<N> operator--(int) {
    Field<N> r{*this};
    --*this;
    return r;
  }
  inline bool operator==(const Field<N>& o) { return o.v == v; }
  inline explicit operator unsigned int() const { return v; }
  inline static vector<Field<N>> fact(int t) {
    vector<Field<N>> F(t + 1, 1);
    for (int i = 2; i <= t; ++i) {
      F[i] = F[i - 1] * i;
    }
    return F;
  }
  inline static vector<Field<N>> invfact(int t) {
    vector<Field<N>> F(t + 1, 1);
    for (int i = 2; i <= t; ++i) {
      F[i] = F[i - 1] / i;
    }
    return F;
  }

 private:
  unsigned int v;
};
template <unsigned int N>
istream& operator>>(std::istream& is, Field<N>& f) {
  unsigned int v;
  is >> v;
  f = v;
  return is;
}
template <unsigned int N>
ostream& operator<<(std::ostream& os, const Field<N>& f) {
  return os << (unsigned int)f;
}
template <unsigned int N>
Field<N> operator+(int i, const Field<N>& f) {
  return Field<N>(i) + f;
}
template <unsigned int N>
Field<N> operator-(int i, const Field<N>& f) {
  return Field<N>(i) - f;
}
template <unsigned int N>
Field<N> operator*(int i, const Field<N>& f) {
  return Field<N>(i) * f;
}
template <unsigned int N>
Field<N> operator/(int i, const Field<N>& f) {
  return Field<N>(i) / f;
}
int Z = 100005;
class TaskC {
 public:
  void solve(istream& cin, ostream& cout) {
    int Q;
    cin >> Q;
    string S;
    cin >> S;
    vector<Field<1000000007>> F = Field<1000000007>::fact(Z);
    vector<Field<1000000007>> I = Field<1000000007>::invfact(Z);
    vector<Field<1000000007>> P26(Z), P25(Z), P(Z);
    P25[0] = P26[0] = P[0] = 1;
    for (int i = 1; i < Z; ++i) {
      P25[i] = P25[i - 1] * 25;
      P26[i] = P26[i - 1] * 26;
      P[i] = P25[i] / P26[i];
    }
    vector<pair<std::pair<int, int>, int>> M;
    for (int i = 0; i < Q; ++i) {
      int T;
      cin >> T;
      if (T == 1) {
        cin >> S;
      } else {
        int N;
        cin >> N;
        int f = M.size();
        M.push_back({{S.size(), N}, f});
      }
    }
    if (M.size() == 0) return;
    vector<Field<1000000007>> R(M.size());
    sort(M.begin(), M.end());
    int lastL = 0;
    int lastN = 0;
    Field<1000000007> ans = 0;
    for (auto& m : M) {
      int L = m.first.first;
      int N = m.first.second;
      if (N < L) {
        R[m.second] = 0;
        continue;
      }
      if (lastL != L) {
        ans = 0;
        lastN = L - 1;
        lastL = L;
      }
      for (int i = lastN + 1; i <= N; ++i) {
        ans += F[i - 1] * I[i - L] * I[L - 1] * P[i];
      }
      R[m.second] = ans * P26[N] / P25[L];
      lastN = N;
    }
    for (auto& r : R) cout << r << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  TaskC solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}