func_code_string: #include <bits/stdc++.h>   using namespace std;   int const bound = 2e6 + 2, N = 5e5 + 2;   long long OO = 1e18;   double eps = 1e-6;   int oo = 1e9, mod = oo + 7;   pair<int, int> can[101];   bool cmp(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {     if (a.first.first != b.first.first) return a.first.first > b.first.first;     return a.first.second < b.first.second;   }   int main() {     int n, m, k, a;     cin >> n >> k >> m >> a;     for (int(i) = 0; (i) < (a); (i)++) {       int g;       cin >> g;       g--;       can[g].first++;       can[g].second = i;     }     for (int(i) = 0; (i) < (n); (i)++) {       pair<pair<int, int>, int> tmp[101];       for (int(j) = 0; (j) < (n); (j)++) tmp[j] = {can[j], j};       int sv = tmp[i].first.second;       tmp[i].first.first += m - a;       if (m - a) tmp[i].first.second = m;       sort(tmp, tmp + n, cmp);       bool no = 1;       for (int(j) = 0; (j) < (k); (j)++) {         if (tmp[j].first.first && tmp[j].second == i) {           no = 0;           break;         }       }       if (no) {         cout << 3 <<    ;         continue;       }       int to = -1, rem = m - a;       for (int(j) = 0; (j) < (n); (j)++)         if (tmp[j].second == i) {           tmp[j].first.first -= m - a;           tmp[j].first.second = sv;         }       sort(tmp, tmp + n, cmp);       for (int(j) = 0; (j) < (n); (j)++) {         if (to != -1) {           if (rem < to - tmp[j].first.first + 1) break;           rem -= to - tmp[j].first.first + 1;           tmp[j].first.first += to - tmp[j].first.first + 1;           tmp[j].first.second = m;         }         if (tmp[j].second == i) to = tmp[j].first.first;       }       sort(tmp, tmp + n, cmp);       no = 1;       for (int(j) = 0; (j) < (k); (j)++)         if (tmp[j].first.first && tmp[j].second == i) no = 0;       if (no)         cout << 2 <<    ;       else         cout << 1 <<    ;     }     return 0;   }   