#include <bits/stdc++.h>
using namespace std;
const int MaxN(200003);
int tag[MaxN << 2], n, m;
long long a[MaxN];
struct node_t {
  int a[11];
  node_t operator+(node_t T) {
    node_t ans;
    for (int i = 0; i <= m; i++) ans.a[i] = a[T.a[i]];
    return ans;
  }
} seg[MaxN << 2][2], s[2];
inline void upd(int rt) {
  tag[rt] ^= 1;
  swap(seg[rt][0], seg[rt][1]);
}
inline void pushup(int rt) {
  seg[rt][0] = seg[rt << 1][0] + seg[rt << 1 | 1][0];
  seg[rt][1] = seg[rt << 1][1] + seg[rt << 1 | 1][1];
}
inline void pushdown(int rt) {
  if (tag[rt]) {
    upd(rt << 1), upd(rt << 1 | 1);
    tag[rt] = 0;
  }
}
void Build(int rt, int l, int r) {
  if (l == r) {
    seg[rt][a[l]] = s[1];
    seg[rt][a[l] ^ 1] = s[0];
    return;
  }
  int m = (l + r) >> 1;
  Build(rt << 1, l, m), Build(rt << 1 | 1, m + 1, r);
  pushup(rt);
}
void Modify(int rt, int l, int r, int ml, int mr) {
  if (ml <= l && r <= mr) {
    upd(rt);
    return;
  }
  pushdown(rt);
  int m = (l + r) >> 1;
  if (ml <= m) Modify(rt << 1, l, m, ml, mr);
  if (mr > m) Modify(rt << 1 | 1, m + 1, r, ml, mr);
  pushup(rt);
}
node_t Query(int rt, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) return seg[rt][0];
  int m = (l + r) >> 1;
  pushdown(rt);
  if (qr <= m) return Query(rt << 1, l, m, ql, qr);
  if (ql > m) return Query(rt << 1 | 1, m + 1, r, ql, qr);
  return Query(rt << 1, l, m, ql, qr) + Query(rt << 1 | 1, m + 1, r, ql, qr);
}
int main() {
  int Q;
  scanf("%d%d%d", &n, &m, &Q);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]), a[i] &= 1;
  for (int i = 0; i <= m; i++) s[1].a[i] = min(i + 1, m);
  s[0] = s[1], s[0].a[m] = 0;
  Build(1, 1, n);
  for (int op, l, r; Q--;) {
    scanf("%d%d%d", &op, &l, &r);
    if (op == 1) {
      long long d;
      scanf("%lld", &d);
      if (d & 1) Modify(1, 1, n, l, r);
    } else
      printf("%d\n", (Query(1, 1, n, l, r).a[m] == 0) + 1);
  }
  return 0;
}
