func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MX = 5005;   int n, m;   int n1, n2, n3;   vector<int> g[5005];   int pars[5005];   map<int, vector<int>> roots;   vector<int> roots_v;   vector<int> cs;   int rootNum = 0;   bool dp[5005][5005][2];   int find(int u) {     if (pars[u] == u) return u;     int p = find(pars[u]);     pars[u] = p;     return p;   }   void un(int u, int v) {     int pu = find(u), pv = find(v);     pars[pv] = pu;   }   bool color(int u, int c) {     stack<vector<int>> sk;     sk.push({u, c});     while (!sk.empty()) {       vector<int> it = sk.top();       sk.pop();       u = it[0];       c = it[1];       if (cs[u] != 0 && cs[u] != c) return false;       if (cs[u] != 0) continue;       int pu = find(u);       cs[u] = c;       roots[pu][c]++;       int nc = c == 1 ? 2 : 1;       for (int v : g[u]) {         if (cs[v] == 0) sk.push({v, nc});       }     }     return true;   }   void solve() {     for (int u = 1; u <= n; u++) {       pars[u] = u;     }     for (int u = 1; u <= n; u++) {       for (int v : g[u]) {         un(u, v);       }     }     for (int u = 1; u <= n; u++) {       int pu = find(u);       roots[pu] = vector<int>(3);     }     cs = vector<int>(n + 1, 0);     for (auto it = roots.begin(); it != roots.end(); it++) {       int u = it->first;       roots_v.push_back(u);       if (!color(u, 1)) {         cout <<  NO  << endl;         return;       }     }     rootNum = roots.size();     memset(dp, 0, sizeof(dp));     int root = roots_v[0];     if (roots[root][2] <= n2) dp[0][roots[root][2]][0] = 1;     if (roots[root][1] <= n2) dp[0][roots[root][1]][1] = 1;     for (int i = 1; i < rootNum; i++) {       root = roots_v[i];       int c1 = roots[root][1], c2 = roots[root][2];       for (int v = 0; v <= n2; v++) {         if (v >= c2) {           dp[i][v][0] = dp[i - 1][v - c2][0] || dp[i - 1][v - c2][1];         }         if (v >= c1) {           dp[i][v][1] = dp[i - 1][v - c1][0] || dp[i - 1][v - c1][1];         }       }     }     if (!dp[rootNum - 1][n2][0] && !dp[rootNum - 1][n2][1]) {       cout <<  NO  << endl;       return;     }     int i = rootNum - 1;     int tar = n2;     map<int, int> reverse;     while (i >= 0) {       int root = roots_v[i];       if (dp[i][tar][1]) {         reverse[root] = 1;         tar -= roots[root][1];       } else {         reverse[root] = 0;         tar -= roots[root][2];       }       i--;     }     for (int u = 1; u <= n; u++) {       int pu = find(u);       if (reverse[pu]) {         cs[u] = cs[u] == 1 ? 2 : 1;       }     }     int x = n3;     for (int u = 1; u <= n && x; u++) {       if (cs[u] == 1) {         cs[u] = 3;         x--;       }     }     cout <<  YES  << endl;     for (int u = 1; u <= n; u++) {       cout << cs[u];     }     cout << endl;   }   int main() {     cin >> n >> m >> n1 >> n2 >> n3;     for (int i = 0; i < m; i++) {       int u, v;       cin >> u >> v;       g[u].push_back(v);       g[v].push_back(u);     }     solve();     return 0;   }   