#include <bits/stdc++.h> using namespace std; typedef pair< int, int> ii; const int N = 5e5 + 5; int a[N], n; ii b[N], c[N]; int bit[N]; void updr(int x) { for(; x; x -= x&(-x)) bit[x]++; } int getr(int x) { int ret = 0; for(; x <= n; x += x&(-x)) ret += bit[x]; return ret; } void updl(int x) { for(; x <= n; x += x&(-x)) bit[x]++; } int getl(int x) { int ret = 0; for(; x; x -= x&(-x)) ret += bit[x]; return ret; } int main() { scanf("%d", &n); for(int i = 1; i<=n; i++) scanf("%d", a+i); for(int i = 1; i<=n; i++) { updr(a[i]); b[i] = make_pair(-getr(a[i]), i); } for(int i = 0; i<= n; i++) bit[i] = 0; for(int i = n; i>=1; i--) { updl(a[i]); c[i] = make_pair(-getl(a[i]), i); } sort(b+1, b+n+1); sort(c+1, c+n+1); int p, q; p = q = -1; for(int i = 1; i<=n; i++) { if(c[1].second < b[i].second && a[c[1].second] > a[b[i].second] ) { p = c[1].second; q = b[i].second; break; } } for(int i = 1; i<=n; i++) { if(c[i].second < b[1].second && a[c[i].second] > a[b[1].second] ) { int cnt = 0; for(int j = p; j<=q; j++) cnt += (a[j] <= a[p] && a[j] >= a[q]); int tmp = 0; for(int j = c[i].second; j<=b[1].second; j++) tmp += (a[j] <= a[c[i].second] && a[j] >= a[b[1].second]); if(tmp > cnt) { p = c[i].second; q = b[1].second; } break; } } if(p != -1 && q != -1) printf("%d %d\n", p, q); else puts("Cool Array"); return 0; }