#include <bits/stdc++.h>
using namespace std;
template <class T, class first>
inline bool checkbit(T a, first pos) {
  T t = 1;
  return ((a & (t << pos)) > 0);
}
template <class T, class first>
inline T setbit(T a, first pos) {
  T t = 1;
  return (a | (t << pos));
}
template <class T, class first>
inline T resetbit(T a, first pos) {
  T t = 1;
  return (a & (~(t << pos)));
}
template <class T, class first>
inline T togglebit(T a, first pos) {
  T t = 1;
  return (a ^ (t << pos));
}
template <typename T>
T POW(T B, T printf) {
  if (printf == 0) return 1;
  if (printf & 1)
    return B * POW(B, printf - 1);
  else
    return (POW(B, printf / 2) * POW(B, printf / 2));
}
template <typename T>
T Bigmod(T base, T power, T mod) {
  T ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % mod;
    base = (base * base) % mod;
    power >>= 1;
  }
  return ret;
}
template <typename T>
T ModInverse(T number, T mod) {
  return Bigmod(number, mod - 2, mod);
}
template <typename T>
T GCD(T a, T b) {
  if (a < 0) return GCD(-a, b);
  if (b < 0) return GCD(a, -b);
  return (b == 0) ? a : GCD(b, a % b);
}
template <typename T>
T LCM(T a, T b) {
  if (a < 0) return LCM(-a, b);
  if (b < 0) return LCM(a, -b);
  return a * (b / GCD(a, b));
}
template <typename T>
T EUCLIDE(T a, T b, T &x, T &y) {
  if (a < 0) {
    T d = euclide(-a, b, x, y);
    x = -x;
    return d;
  }
  if (b < 0) {
    T d = euclide(a, -b, x, y);
    y = -y;
    return d;
  }
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    T d = euclide(b, a % b, x, y);
    T t = x;
    x = y;
    y = t - (a / b) * y;
    return d;
  }
}
template <typename T>
T ABS(T a) {
  if (a < 0)
    return -a;
  else
    return a;
}
double DEG(double x) { return (180.0 * x) / ((2.0 * acos(0.0))); }
double RAD(double x) { return (x * (double)(2.0 * acos(0.0))) / (180.0); }
template <typename T>
T DIS(T x1, T y1, T x2, T y2) {
  return sqrt((double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
}
template <typename T>
T ANGLE(T x1, T y1, T x2, T y2) {
  return atan(double(y1 - y2) / double(x1 - x2));
}
template <typename T>
long long isLeft(T a, T b, T c) {
  return (c.x - a.x) * (b.y - a.y) - (b.x - a.x) * (c.y - a.y);
}
template <class T>
inline bool setmin(T &a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
inline bool setmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
void P_ARR(int *ar, int a, int b) {
  if (a > b) swap(a, b);
  if (a <= b) cout << ar[a];
  for (int i = a + 1; i <= b; i++) cout << " " << ar[i];
  cout << endl;
}
template <typename T>
T in() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
long long ar[100007];
struct data {
  int lazy;
  long long ar[50];
  data() {}
  data(long long a) {
    for (int i = 0; i <= 47; i++) {
      ar[i] = a;
      a = (((a * a) % 95542721) * a) % 95542721;
    }
    lazy = 0;
  }
  void update(int v) { lazy = (lazy + v) % 48; }
  long long Sum(int cnt) { return ar[(lazy + cnt) % 48]; }
} tree[4 * 100007];
void build(int idx, int s, int e) {
  tree[idx].lazy = 0;
  if (s == e)
    tree[idx] = data(ar[s]);
  else {
    int mid = (s + e) >> 1, l = (idx << 1), r = (l | 1);
    build(l, s, mid);
    build(r, mid + 1, e);
    for (int i = 0; i <= 47; i++)
      tree[idx].ar[i] = tree[l].ar[i] + tree[r].ar[i];
  }
}
void push_down(int idx, int l, int r) {
  tree[l].lazy = (tree[l].lazy + tree[idx].lazy) % 48;
  tree[r].lazy = (tree[r].lazy + tree[idx].lazy) % 48;
  tree[idx].lazy = 0;
}
void push_up(int idx, int l, int r) {
  for (int i = 0; i <= 47; i++)
    tree[idx].ar[i] = (tree[l].Sum(i) + tree[r].Sum(i)) % 95542721;
}
void update(int idx, int s, int e, int x, int y) {
  if (s == x && e == y) {
    tree[idx].update(1);
    return;
  }
  int mid = (s + e) >> 1, l = (idx << 1), r = (l | 1);
  if (tree[idx].lazy) push_down(idx, l, r);
  if (y <= mid)
    update(l, s, mid, x, y);
  else if (x > mid)
    update(r, mid + 1, e, x, y);
  else {
    update(l, s, mid, x, mid);
    update(r, mid + 1, e, mid + 1, y);
  }
  push_up(idx, l, r);
}
long long query(int idx, int s, int e, int x, int y) {
  if (s == x && e == y) return (tree[idx].Sum(0)) % 95542721;
  int mid = (s + e) >> 1, l = (idx << 1), r = (l | 1);
  if (tree[idx].lazy) push_down(idx, l, r);
  long long res = 0;
  if (y <= mid)
    res = query(l, s, mid, x, y);
  else if (mid < x)
    res = query(r, mid + 1, e, x, y);
  else {
    long long a = query(l, s, mid, x, mid);
    long long b = query(r, mid + 1, e, mid + 1, y);
    res = (a + b) % 95542721;
  }
  push_up(idx, l, r);
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> ar[i];
  build(1, 1, n);
  int q;
  cin >> q;
  int x, y, t;
  for (int i = 1; i <= q; i++) {
    cin >> t >> x >> y;
    if (t == 1) {
      cout << query(1, 1, n, x, y) % 95542721 << endl;
    } else {
      update(1, 1, n, x, y);
    }
  }
  return 0;
}
