#include <bits/stdc++.h>
const int N = 200000;
const int M = 5;
const int T = 524287;
int n, m, q;
bool a[N];
struct element {
  int v[2][M + 1];
  element() {
    for (int k = 0; k < 2; ++k)
      for (int i = 0; i <= m; ++i) v[k][i] = i;
  }
  element(bool b) {
    for (int k = 0; k < 2; ++k) {
      for (int i = 0; i < m; ++i) v[k][i] = i + 1;
      v[k][m] = (b ^ 1 ^ k) * m;
    }
  }
  element operator+(element ob2) {
    element r;
    for (int k = 0; k < 2; ++k)
      for (int i = 0; i <= m; ++i) r.v[k][i] = v[k][ob2.v[k][i]];
    return r;
  }
  void flip() {
    for (int i = 0; i <= m; ++i) std::swap(v[0][i], v[1][i]);
  }
};
element t[T];
bool upd[T];
void build(int v = 0, int tl = 0, int tr = n) {
  if (tr - tl == 1)
    t[v] = element(a[tl]);
  else {
    int m = (tl + tr) / 2;
    build(v * 2 + 1, tl, m);
    build(v * 2 + 2, m, tr);
    t[v] = t[v * 2 + 1] + t[v * 2 + 2];
  }
}
void push(int v, int tl, int tr) {
  if (upd[v]) {
    t[v].flip();
    if (tr - tl != 1) {
      upd[v * 2 + 1] = !upd[v * 2 + 1];
      upd[v * 2 + 2] = !upd[v * 2 + 2];
    }
    upd[v] = false;
  }
}
void update(int l, int r, int v = 0, int tl = 0, int tr = n) {
  if (tl >= r || tr <= l)
    push(v, tl, tr);
  else if (tl >= l && tr <= r) {
    upd[v] = !upd[v];
    push(v, tl, tr);
  } else {
    push(v, tl, tr);
    int m = (tl + tr) / 2;
    update(l, r, v * 2 + 1, tl, m);
    update(l, r, v * 2 + 2, m, tr);
    t[v] = t[v * 2 + 1] + t[v * 2 + 2];
  }
}
element query(int l, int r, int v = 0, int tl = 0, int tr = n) {
  if (tl >= r || tr <= l) return element();
  push(v, tl, tr);
  if (tl >= l && tr <= r) return t[v];
  int m = (tl + tr) / 2;
  return query(l, r, v * 2 + 1, tl, m) + query(l, r, v * 2 + 2, m, tr);
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 0; i < n; ++i) {
    long long v;
    scanf("%lld", &v);
    a[i] = v & 1;
  }
  build(0);
  while (q--) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int l, r;
      long long d;
      scanf("%d%d%lld", &l, &r, &d);
      if (d & 1) update(l - 1, r);
    } else {
      int l, r;
      scanf("%d%d", &l, &r);
      printf("%d\n", query(l - 1, r).v[0][m] ? 1 : 2);
    }
  }
  return 0;
}
