func_code_string: #include <bits/stdc++.h>   #pragma optimize( O3 )   using namespace std;   const long long MOD = 998244353;   const long long INF = 1e8 + 7;   const int base = 2e5 + 1;   const long long MAX = 3 * 1e5 + 1;   const double EPS = 1e-9;   const double PI = acos(-1.);   const int MAXN = 5 * 1e5 + 47;   mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());   vector<vector<int> > g(MAXN), tb(MAXN);   vector<int> res;   int t[MAXN], was[MAXN];   int get(int v) {     was[v] = 1;     set<int> s;     for (auto u : g[v]) {       if (was[u]) s.insert(t[u]);     }     for (int i = (1); i < (MAXN); ++i) {       if (!s.count(i)) return i;     }   }   int main() {     int n, m;     cin >> n >> m;     for (int i = (0); i < (m); ++i) {       int v, u;       scanf( %d %d , &v, &u);       v--;       u--;       g[v].push_back(u);       g[u].push_back(v);     }     for (int i = (0); i < (n); ++i) {       scanf( %d , &t[i]);       tb[t[i]].push_back(i);     }     for (int i = (1); i < (n + 1); ++i) {       for (auto v : tb[i]) {         if (get(v) != i) {           cout << -1;           return 0;         }         res.push_back(v + 1);       }     }     for (auto v : res) printf( %d  , v);     return 0;   }   