#include <bits/stdc++.h>
using namespace std;
const int nMAX = 100005;
const int kMOD = 1e9 + 7;
int n;
int m;
int q;
int sol[nMAX];
string useless;
vector<pair<int, int>> qs[nMAX];
int fc[nMAX];
int in[nMAX];
int p25[nMAX];
int Expo(int x, int y) {
  if (y == 1) {
    return x;
  } else {
    int v = Expo(x, y / 2);
    v = 1ll * v * v % kMOD;
    if (y & 1) v = 1ll * v * x % kMOD;
    return v;
  }
}
void Precalculate() {
  fc[0] = 1;
  in[0] = 1;
  p25[0] = 1;
  for (int i = 1; i < nMAX; i++) {
    fc[i] = 1ll * fc[i - 1] * i % kMOD;
    in[i] = Expo(fc[i], kMOD - 2);
    p25[i] = 1ll * p25[i - 1] * 25 % kMOD;
  }
}
inline int nChooseK(int n, int k) {
  int a = fc[n];
  int b = 1ll * in[k] * in[n - k] % kMOD;
  return 1ll * a * b % kMOD;
}
int waysSolve[nMAX];
void getWays(int k) {
  waysSolve[k] = 1;
  for (int i = k; i < nMAX - 1; i++)
    waysSolve[i + 1] = (26ll * waysSolve[i] % kMOD +
                        1ll * p25[i - k + 1] * nChooseK(i, k - 1) % kMOD) %
                       kMOD;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> m;
  cin >> useless;
  Precalculate();
  n = useless.size();
  for (int i = 1; i <= m; i++) {
    int t;
    cin >> t;
    if (t == 1) {
      cin >> useless;
      n = useless.size();
    } else {
      int l;
      cin >> l;
      q++;
      if (n <= l) qs[n].push_back({l, q});
    }
  }
  for (int i = 1; i < nMAX; i++) {
    if (qs[i].size() > 0) {
      getWays(i);
      for (auto &qq : qs[i]) sol[qq.second] = waysSolve[qq.first];
    }
  }
  for (int i = 1; i <= q; i++) cout << sol[i] << "\n";
  return 0;
}
