func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, flag;     cin >> n >> m;     int l[m], ans[n], check[n];     memset(ans, 0, sizeof(ans));     memset(check, 0, sizeof(check));     for (int i = 0; i < m; i++) cin >> l[i];     for (int i = 0; i < m - 1; i++) {       if (l[i + 1] > l[i]) {         flag = 0;         if (ans[l[i] - 1] != 0) {           if (ans[l[i] - 1] != l[i + 1] - l[i]) {             cout <<  -1 ;             return 0;           } else             flag = 1;         }         ans[l[i] - 1] = l[i + 1] - l[i];         if (check[ans[l[i] - 1] - 1] == 0)           check[ans[l[i] - 1] - 1] = 1;         else if (flag == 0) {           cout <<  -1 ;           return 0;         }       } else {         flag = 0;         if (ans[l[i] - 1] != 0) {           if (ans[l[i] - 1] != l[i + 1] - l[i] + n) {             cout <<  -1 ;             return 0;           } else             flag = 1;         }         ans[l[i] - 1] = l[i + 1] - l[i] + n;         if (check[ans[l[i] - 1] - 1] == 0)           check[ans[l[i] - 1] - 1] = 1;         else if (flag == 0) {           cout <<  -1 ;           return 0;         }       }     }     for (int i = 0; i < n; i++) {       if (ans[i])         cout << ans[i] <<    ;       else {         for (int j = 0; j < n; j++)           if (check[j] == 0) {             cout << j + 1 <<    ;             check[j] = 1;             break;           }       }     }     return 0;   }   