func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, a[1000005], r[3], cnt;   bool up, down;   set<int> s;   int main() {     srand(75435);     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %d , &a[i]);     if (n <= 2) {       cout << -1;       return 0;     }     for (int i = 0; i < n; i++) {       if (s.find(a[i]) == s.end()) {         if (cnt < 3) r[cnt++] = i;         s.insert(a[i]);       }     }     if (cnt == 3) {       if (r[0] > r[1]) swap(r[0], r[1]);       if (r[0] > r[2]) swap(r[0], r[2]);       if (r[1] > r[2]) swap(r[1], r[2]);       if ((a[r[1]] > a[r[0]] && a[r[1]] > a[r[2]]) ||           (a[r[1]] < a[r[0]] && a[r[1]] < a[r[2]])) {         cout << r[0] + 1 <<     << r[2] + 1;         return 0;       }       cout << r[0] + 1 <<     << r[1] + 1 << endl;       return 0;     }     for (int i = 0; i < n - 1; i++)       if (a[i] != a[i + 1]) {         swap(a[i], a[i + 1]);         up = true;         down = true;         for (int j = 0; j < n - 1; j++)           if (a[j] > a[j + 1])             up = false;           else if (a[j] < a[j + 1])             down = false;         if (!down && !up) {           cout << i + 1 <<     << i + 2;           return 0;         }         swap(a[i], a[i + 1]);       }     cout << -1;     return 0;   }   