#include <bits/stdc++.h>
using namespace std;
int lz[400005], f[400005][2][32], n1, t[400005][2], a[400005], n, m, q,
    d[400005];
void up(int k) {
  int l = 1 << m;
  for (int p = 0; p <= 1; ++p)
    for (int j = 0; j <= l - 1; ++j)
      f[k][p][j] = f[t[k][0]][p][f[t[k][1]][p][j]];
}
void upd(int k) { lz[k] ^= 1, swap(f[k][0], f[k][1]); }
void down(int k) {
  if (lz[k]) upd(t[k][0]), upd(t[k][1]), lz[k] = 0;
}
void add(int k, int l, int r, int x, int y) {
  if (x > y || x > r || y < l) return;
  if (x <= l && r <= y)
    upd(k);
  else {
    int mid = (l + r) >> 1;
    down(k);
    add(t[k][0], l, mid, x, y), add(t[k][1], mid + 1, r, x, y);
    up(k);
  }
}
void query(int k, int l, int r, int x, int y) {
  if (x > y || x > r || y < l) return;
  if (x <= l && r <= y)
    d[++d[0]] = k;
  else {
    int mid = (l + r) >> 1;
    down(k);
    query(t[k][0], l, mid, x, y), query(t[k][1], mid + 1, r, x, y);
  }
}
void build(int k, int l, int r) {
  if (l == r) {
    int le = (1 << m);
    for (int j = 0; j <= le - 1; ++j) {
      f[k][a[l]][j] = (j << 1) % le + 1;
      f[k][a[l] ^ 1][j] = (j < le - 1) ? ((j << 1) % le + 1) : (j << 1) % le;
    }
    return;
  }
  int mid = (l + r) >> 1;
  build(t[k][0] = ++n1, l, mid);
  build(t[k][1] = ++n1, mid + 1, r);
  up(k);
}
int main() {
  cin >> n >> m >> q;
  for (int i = 1; i <= n; ++i) {
    long long x;
    scanf("%I64d", &x);
    a[i] = x % 2;
  }
  n1 = 1;
  build(1, 1, n);
  for (int i = 1; i <= q; ++i) {
    int p, x, y;
    long long z;
    scanf("%d%d%d", &p, &x, &y);
    if (p == 1) {
      scanf("%I64d", &z);
      if (z % 2) add(1, 1, n, x, y);
    } else {
      d[0] = 0;
      query(1, 1, n, x, y);
      int s = (1 << m) - 1;
      for (int i = d[0]; i >= 1; --i) s = f[d[i]][0][s];
      if (s % 2 == 0)
        printf("2\n");
      else
        printf("1\n");
    }
  }
}
