#include<bits/stdc++.h>
typedef long long int LL;
using namespace std;
#define getchar_unlocked getchar
inline int read()
{
	int ret = 0;
	int c = getchar_unlocked();

	while(c<'0' || c>'9')
		c = getchar_unlocked();
	while(c>='0' && c<='9')
	{
		ret = (ret<<3) + (ret<<1) + c - '0';
		c = getchar_unlocked();
	}
        return ret;
}
const int N=500005;
int n,a[N];
int rel;
LL bit[N];
void update(int x)
{
    while(x<N){
        bit[x]+=1;
        x+=x&-x;
    }
}
LL query(int x)
{
    LL ret=0;
    while(x>0){
        ret+=bit[x];
        x-=x&-x;
    }
    return ret;
}
int main()
{
    n=read();
    LL to=0;
    int maxshift=0,maxpos=-1;
    for(int i=0;i<n;i++){
        a[i]=read();
        to=to+(LL)(query(N)-query(a[i]));
        update(a[i]);
        rel=abs(a[i]-i);
        if(maxshift<rel){
            maxshift=rel;
            maxpos=i;
        }
    }
    memset(bit,0,sizeof(bit));
    int maxx=-1,maxy=-1;
    LL maxi=to;
    update(a[maxpos]);
    for(int i=maxpos+1;i<n;i++){
        update(a[i]);
        LL temp=to-(query(N)-query(a[i]))+(query(a[i]-1));
        LL xx=query(N)-query(a[maxpos]);
        if(a[maxpos]<a[i]) xx--;
        LL yy=query(a[maxpos]-1);
        if(a[maxpos]>a[i]) yy--;
        temp=temp+xx-yy;
        if(maxi>temp){
            maxi=temp;
            maxx=maxpos;
            maxy=i;
        }
    }
    memset(bit,0,sizeof(bit));
    update(a[maxpos]);
    for(int i=maxpos-1;i>=0;i--){
        update(a[i]);
        LL temp=to-(query(N)-query(a[maxpos]))+(query(a[maxpos]-1));
        LL xx=query(N)-query(a[i]);
        if(a[maxpos]>a[i]) xx--;
        LL yy=query(a[i]-1);
        if(a[maxpos]<a[i]) yy--;
        temp=temp+xx-yy;
        if(maxi>=temp){
            maxi=temp;
            maxx=maxpos;
            maxy=i;
        }
    }
    if(maxx!=-1) printf("%d %d\n",min(maxx,maxy)+1,max(maxx,maxy)+1);
    else printf("Cool Array\n");
    return 0;
}