#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 500005;
ll inter[N];
int n, arr[N], _arr[N];
int ls(int indx) {
return indx & (-indx);
}
void update(int indx, int val) {
for (; indx <= n; indx += ls(indx))
inter[indx] += val;
}
ll get(int indx) {
ll res = 0;
for (; indx > 0; indx -= ls(indx))
res += inter[indx];
return res;
}
int main() {
cin >> n;
for (int i = 0; i < n; ++i)
cin >> arr[i], _arr[i] = arr[i];
int pos = -1;
ll ans = 0, mx = 0;
for (int i = n - 1; i >= 0; --i) {
ll tmp = get(arr[i]);
ans += tmp;
update(arr[i], 1);
if (tmp >= mx) {
mx = tmp;
pos = i;
}
}
if (pos == -1) {
cout << "Cool Array" << endl;
return 0;
}
int x = pos;
reverse(arr, arr + n);
for (int i = 0; i < n; ++i)
arr[i] = n - arr[i] + 1;
ll _ans = 0, _mx = 0;
pos = -1;
ll cnt = 0;
memset(inter, 0, sizeof(inter));
for (int i = n - 1 - x; i >= 0; --i) {
ll tmp = get(arr[i])-cnt;
update(arr[i], 1);
if (tmp > _mx) {
_mx = tmp;
pos = i;
}
cnt+=arr[i] < arr[n-x-1];
}
if (pos == -1)
cout << "Cool Array" << endl;
else
cout << x + 1 << " " << n - pos << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCmNvbnN0IGludCBOID0gNTAwMDA1OwpsbCBpbnRlcltOXTsKaW50IG4sIGFycltOXSwgX2FycltOXTsKaW50IGxzKGludCBpbmR4KSB7CglyZXR1cm4gaW5keCAmICgtaW5keCk7Cn0Kdm9pZCB1cGRhdGUoaW50IGluZHgsIGludCB2YWwpIHsKCWZvciAoOyBpbmR4IDw9IG47IGluZHggKz0gbHMoaW5keCkpCgkJaW50ZXJbaW5keF0gKz0gdmFsOwp9CmxsIGdldChpbnQgaW5keCkgewoJbGwgcmVzID0gMDsKCWZvciAoOyBpbmR4ID4gMDs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