#include <bits/stdc++.h>
using namespace std;
const int mod = 95542721;
const int MAXN = 100005;
struct Segment_Tree {
  int left, right, a[50];
  int c;
} Segtree[MAXN * 3];
int n;
int a[MAXN];
void Build(int p, int l, int r) {
  Segtree[p].left = l;
  Segtree[p].right = r;
  Segtree[p].c = 0;
  if (l == r) {
    Segtree[p].a[0] = a[l];
    for (int i = 1; i < 48; i++)
      Segtree[p].a[i] = (long long)Segtree[p].a[i - 1] * Segtree[p].a[i - 1] %
                        mod * Segtree[p].a[i - 1] % mod;
  } else {
    int mid = (l + r) / 2;
    Build(2 * p, l, mid);
    Build(2 * p + 1, mid + 1, r);
    for (int i = 0; i < 48; i++)
      Segtree[p].a[i] = (Segtree[2 * p].a[i] + Segtree[2 * p + 1].a[i]) % mod;
  }
}
inline void pd(int p) {
  void Change(int, int, int, int);
  int mid = (Segtree[p].left + Segtree[p].right) / 2;
  Change(2 * p, Segtree[p].left, mid, Segtree[p].c);
  Change(2 * p + 1, mid + 1, Segtree[p].right, Segtree[p].c);
  Segtree[p].c = 0;
}
inline void pu(int p) {
  for (int i = 0; i < 48; i++)
    Segtree[p].a[i] = (Segtree[2 * p].a[i] + Segtree[2 * p + 1].a[i]) % mod;
}
int tmp[100];
void Change(int p, int l, int r, int k) {
  if (Segtree[p].left == l && Segtree[p].right == r) {
    for (int i = 0; i < 48; i++) tmp[i] = Segtree[p].a[i];
    for (int i = 48; i < 96; i++) tmp[i] = tmp[i - 48];
    for (int i = 0; i < 48; i++) Segtree[p].a[i] = tmp[i + k];
    Segtree[p].c += k;
    Segtree[p].c %= 48;
  } else {
    if (Segtree[p].c != 0) pd(p);
    int mid = (Segtree[p].left + Segtree[p].right) / 2;
    if (r <= mid)
      Change(2 * p, l, r, k);
    else if (l > mid)
      Change(2 * p + 1, l, r, k);
    else
      Change(2 * p, l, mid, k), Change(2 * p + 1, mid + 1, r, k);
    pu(p);
  }
}
int Query(int p, int l, int r) {
  if (Segtree[p].left == l && Segtree[p].right == r) {
    return Segtree[p].a[0];
  } else {
    if (Segtree[p].c != 0) pd(p);
    int mid = (Segtree[p].left + Segtree[p].right) / 2;
    if (r <= mid)
      return Query(2 * p, l, r);
    else if (l > mid)
      return Query(2 * p + 1, l, r);
    else
      return (Query(2 * p, l, mid) + Query(2 * p + 1, mid + 1, r)) % mod;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) a[i] %= mod;
  Build(1, 1, n);
  int T;
  scanf("%d", &T);
  while (T--) {
    int o, l, r;
    scanf("%d%d%d", &o, &l, &r);
    if (o == 1)
      printf("%d\n", Query(1, l, r));
    else
      Change(1, l, r, 1);
  }
  return 0;
}
