#include <bits/stdc++.h>
using namespace std;
struct boi {
  int cnt, poz, cand;
} f[105];
bool mycmp(boi a, boi b) {
  if (a.cnt == b.cnt) return a.cand < b.cand;
  return a.cnt > b.cnt;
}
int viz[105];
int main() {
  int n, k, m, a, x;
  cin >> n >> k >> m >> a;
  for (int i = 1; i <= a; i++) {
    cin >> x;
    f[x].cnt++;
    f[x].poz = x;
    f[x].cand = i;
  }
  if (k == n) {
    if (m - a >= 1) {
      for (int i = 1; i <= n; i++) {
        if (f[i].cnt >= 1)
          cout << 1 << " ";
        else
          cout << 2 << " ";
      }
    } else {
      for (int i = 1; i <= n; i++) {
        if (f[i].cnt >= 1)
          cout << 1 << " ";
        else
          cout << 3 << " ";
      }
    }
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (f[i].cnt == 0) {
      f[i].poz = i;
      f[i].cand = m;
    }
  }
  sort(f + 1, f + n + 1, mycmp);
  if (m - a == 0) {
    for (int i = 1; i <= k; i++)
      if (f[i].cnt >= 1) viz[f[i].poz] = 1;
    for (int i = 1; i <= n; i++) {
      if (viz[i] == 1) {
        cout << 1 << " ";
      } else {
        cout << 3 << " ";
      }
    }
    return 0;
  }
  int poz1 = 1;
  f[n + 1].cnt = 1000000000;
  for (int i = 1; i <= n; i++) {
    if (f[i].cnt >= f[i + 1].cnt + m - a && f[i].cnt != 0) {
      int poz7 = 0;
      for (int t = i; t <= n; t++) {
        if (f[i].cnt == f[t].cnt) poz7++;
      }
      if (poz7 > k)
        f[i + 1].cnt = 0;
      else {
        k--;
        viz[f[i].poz] = 1;
        poz1++;
      }
    } else {
      if (m - a == 0) {
        if (n - i + 1 > k) {
          k = 0;
          break;
        } else {
          for (int j = i; j <= n; j++) viz[f[j].poz] = 1;
        }
        k = 0;
      }
      break;
    }
  }
  if (k == 0) {
    for (int i = 1; i <= n; i++) {
      if (viz[i] == 1) {
        cout << 1 << " ";
      } else {
        cout << 3 << " ";
      }
    }
    return 0;
  }
  int r = poz1, ok1 = 1;
  for (int i = poz1; i <= n; i++) {
    int cnt2 = m - a;
    int poz3 = k;
    int t7 = 0;
    if (k == 0) break;
    if (f[i].cnt == 0 && n - i + 1 > k) {
      break;
      k = 0;
    }
    for (int j = i + 1; j <= n; j++) {
      if (f[j].cnt + cnt2 <= f[i].cnt && t7 < k) {
        int poz1 = 0;
        for (int t = i; t <= n; t++) {
          if (f[i].cnt == f[t].cnt) poz1++;
        }
        if (poz1 > k) break;
        viz[f[i].poz] = 1;
        k--;
        r++;
        break;
      } else {
        cnt2 = cnt2 - (f[i].cnt - f[j].cnt + 1);
        t7++;
        poz3--;
      }
      if (poz3 == 0) {
        ok1 = 0;
        break;
      }
    }
    if (ok1 == 0) break;
  }
  if (k == 0) {
    for (int i = 1; i <= n; i++) {
      if (viz[i] == 1) {
        cout << 1 << " ";
      } else {
        cout << 3 << " ";
      }
    }
    return 0;
  }
  int k2 = k;
  int last3, ok = 1;
  for (int i = r; i <= n; i++) {
    if (f[i].cnt == 0 && f[i - 1].cnt == 0) {
      for (int j = i; j <= n; j++) {
        viz[f[j].poz] = 2;
      }
      break;
    }
    if (k2 > 0) {
      if (f[i].cnt + m - a > f[i - 1].cnt) {
        viz[f[i].poz] = 2;
        k2--;
      } else {
        for (int u = 1; u <= k2; u++) {
          viz[f[u + i - 1].poz] = 2;
        }
        for (int u = i + k2; u <= n; u++) {
          if (f[u].cnt + m - a >= f[i + k2 - 1].cnt) viz[f[u].poz] = 2;
        }
        break;
      }
    } else {
      if (f[i].cnt + m - a > f[last3].cnt) {
        viz[f[i].poz] = 2;
      } else
        break;
    }
    if (k2 == 0 && ok == 1) {
      last3 = i;
      ok = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (viz[i] == 1) {
      cout << 1 << " ";
    } else {
      if (viz[i] == 2) {
        cout << 2 << " ";
      } else
        cout << 3 << " ";
    }
  }
  return 0;
}
