#include <bits/stdc++.h>
using namespace std;
int n, q, m;
long long a[int(2e5 + 20)];
struct st {
  int re[2][6];
  st() {
    for (int i = 0; i < m; i++) re[0][i] = re[1][i] = i + 1;
    re[0][m] = m;
    re[1][m] = 0;
  }
  inline st mr(st g) {
    st ru;
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < m + 1; j++) ru.re[i][j] = re[i][g.re[i][j]];
    return ru;
  }
  inline void flip() {
    for (int i = 0; i < m + 1; i++) swap(re[0][i], re[1][i]);
  }
} se[4 * int(2e5 + 20)];
int lz[4 * int(2e5 + 20)];
void build(int l = 0, int r = n, int id = 1) {
  if (r - l == 1) {
    se[id] = st();
    if (a[l] & 1) se[id].flip();
    return;
  }
  int mid = l + r >> 1;
  build(l, mid, id << 1);
  build(mid, r, id << 1 | 1);
  se[id] = se[id << 1].mr(se[id << 1 | 1]);
}
void su(int s, int t, int l = 0, int r = n, int id = 1) {
  if (l >= t || r <= s) return;
  if (l >= s && r <= t) {
    lz[id] ^= 1;
    se[id].flip();
    return;
  }
  int mid = l + r >> 1;
  su(s, t, l, mid, id << 1);
  su(s, t, mid, r, id << 1 | 1);
  se[id] = se[id << 1].mr(se[id << 1 | 1]);
  if (lz[id]) se[id].flip();
}
st sz(int s, int t, int l = 0, int r = n, int id = 1) {
  if (l >= s && r <= t) return se[id];
  int mid = l + r >> 1;
  st re;
  if (t <= mid)
    re = sz(s, t, l, mid, id << 1);
  else if (s >= mid)
    re = sz(s, t, mid, r, id << 1 | 1);
  else
    re = sz(s, t, l, mid, id << 1).mr(sz(s, t, mid, r, id << 1 | 1));
  if (lz[id]) re.flip();
  return re;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  build();
  while (q--) {
    int tp, l, r;
    cin >> tp >> l >> r;
    if (tp == 1) {
      long long d;
      cin >> d;
      if (d & 1) su(l - 1, r);
    } else
      cout << (sz(l - 1, r).re[0][m] ? 1 : 2) << '\n';
  }
  return 0;
}
