func_code_string: #include <bits/stdc++.h>   const int mod = 1000000007;   using namespace std;   pair<int, int> a[12345];   vector<int> ans[3];   map<pair<int, int>, bool> used;   map<int, int> cnts;   int main() {     int n;     cin >> n;     for (int i = 0; i < n; ++i) {       scanf( %d , &a[i].first);       a[i].second = i + 1;       cnts[a[i].first]++;     }     int x = 0, y = 0;     for (map<int, int>::iterator it = cnts.begin(); it != cnts.end(); ++it) {       if (it->second >= 3)         y++;       else {         if (it->second == 2) {           x++;         }       }     }     if (x >= 2 || y >= 1) {       puts( YES );       sort(a, a + n);       for (int i = 0; i < n; ++i) {         ans[0].push_back(a[i].second);         if (i != n) {           used[make_pair(i, i + 1)] = false;           used[make_pair(i + 1, i)] = false;         }       }       int temp;       for (int i = 0; i < n - 1; ++i) {         if (!used[make_pair(i, i + 1)] && a[i].first == a[i + 1].first) {           temp = a[i].second;           a[i].second = a[i + 1].second;           a[i + 1].second = temp;           used[make_pair(i, i + 1)] = true;           used[make_pair(i + 1, i)] = true;           break;         }       }       for (int i = 0; i < n; ++i) {         ans[1].push_back(a[i].second);       }       for (int i = 0; i < n - 1; ++i) {         if (!used[make_pair(i, i + 1)] && a[i].first == a[i + 1].first) {           temp = a[i].second;           a[i].second = a[i + 1].second;           a[i + 1].second = temp;           used[make_pair(i, i + 1)] = true;           used[make_pair(i + 1, i)] = true;           break;         }       }       for (int i = 0; i < n; ++i) {         ans[2].push_back(a[i].second);       }       for (int i = 0; i < 3; ++i) {         for (int j = 0; j < ans[i].size(); ++j) {           printf( %d  , ans[i][j]);         }         printf(  n );       }     } else {       cout <<  NO  << endl;       return 0;     }     return 0;   }   