Problem: Gardener Alex loves to grow trees. We remind that tree is a connected acyclic graph on n vertices. 

Today he decided to grow a rooted binary tree. A binary tree is a tree where any vertex has no more than two sons. Luckily, Alex has a permutation of numbers from 1 to n which he was presented at his last birthday, so he decided to grow a tree according to this permutation. To do so he does the following process: he finds a minimum element and makes it a root of the tree. After that permutation is divided into two parts: everything that is to the left of the minimum element, and everything that is to the right. The minimum element on the left part becomes the left son of the root, and the minimum element on the right part becomes the right son of the root. After that, this process is repeated recursively on both parts.

Now Alex wants to grow a forest of trees: one tree for each cyclic shift of the permutation. He is interested in what cyclic shift gives the tree of minimum depth. Unfortunately, growing a forest is a hard and long process, but Alex wants the answer right now. Will you help him?

We remind that cyclic shift of permutation a_1, a_2, …, a_k, …, a_n for k elements to the left is the permutation a_{k + 1}, a_{k + 2}, …, a_n, a_1, a_2, …, a_k.

Input

First line contains an integer number n ~ (1 ⩽ n ⩽ 200 000) — length of the permutation.

Second line contains n integer numbers a_1, a_2, …, a_n ~ (1 ⩽ a_i ⩽ n), and it is guaranteed that all numbers occur exactly one time.

Output

Print two numbers separated with space: minimum possible depth of a tree and how many elements we need to shift left to achieve this depth. The number of elements should be a number from 0 to n - 1. If there are several possible answers, print any of them.

Example

Input


4
1 2 3 4


Output


3 2

Note

The following picture depicts all possible trees for sample test and cyclic shifts on which they are achieved. 

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long md = 1000000007) {
  long long res = 1;
  x %= md;
  while (y > 0) {
    if (y & 1) res = (res * x) % md;
    x = (x * x) % md;
    y = y >> 1;
  }
  return res % md;
}
long long max1(long long a, long long b, long long c = -1000000000000000000LL,
               long long d = -1000000000000000000LL) {
  long long mx1 = (a > b) ? a : b, mx2 = (c > d) ? c : d;
  return ((mx1 > mx2) ? mx1 : mx2);
}
long long tree[800005] = {0};
long long lazy[800005] = {0};
void update_tree(long long node, long long a, long long b, long long i,
                 long long j, long long value) {
  if (lazy[node] != 0) {
    tree[node] += lazy[node];
    if (a != b) {
      lazy[node * 2 + 1] += lazy[node];
      lazy[node * 2 + 2] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (a > b || a > j || b < i) return;
  if (a >= i && b <= j) {
    tree[node] += value;
    if (a != b) {
      lazy[node * 2 + 1] += value;
      lazy[node * 2 + 2] += value;
    }
    return;
  }
  update_tree(node * 2 + 1, a, (a + b) / 2, i, j, value);
  update_tree(node * 2 + 2, (a + b) / 2 + 1, b, i, j, value);
  tree[node] = max(tree[node * 2 + 1], tree[node * 2 + 2]);
}
long long query_tree(long long node, long long a, long long b, long long i,
                     long long j) {
  if (a > b || a > j || b < i) return -1000000000000000000LL;
  if (lazy[node] != 0) {
    tree[node] += lazy[node];
    if (a != b) {
      lazy[node * 2 + 1] += lazy[node];
      lazy[node * 2 + 2] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (a >= i && b <= j) return tree[node];
  long long q1 = query_tree(node * 2 + 1, a, (a + b) / 2, i, j);
  long long q2 = query_tree(node * 2 + 2, (a + b) / 2 + 1, b, i, j);
  return max(q1, q2);
}
long long seg[800005];
void update(long long index, long long ss, long long se, long long id,
            long long val) {
  if (ss == se) {
    seg[index] = val;
    return;
  }
  if (id > se || id < ss) return;
  long long mid = (ss + se) / 2;
  update(index * 2 + 1, ss, mid, id, val);
  update(index * 2 + 2, mid + 1, se, id, val);
  seg[index] = max(seg[index * 2 + 1], seg[index * 2 + 2]);
}
long long query(long long index, long long ss, long long se, long long qs,
                long long qe) {
  if (qs <= ss && se <= qe) return seg[index];
  if (qs > se || qe < ss) return -1000000000000000000LL;
  long long mid = (ss + se) / 2;
  return max(query(index * 2 + 1, ss, mid, qs, qe),
             query(index * 2 + 2, mid + 1, se, qs, qe));
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  for (long long i = 0; i <= 800004; i++) seg[i] = 0;
  long long n;
  cin >> n;
  vector<long long> v(n), vv;
  map<long long, long long> make_pair;
  for (long long i = 0; i < n; i++) cin >> v[i], make_pair[v[i] - 1] = i;
  for (long long i = make_pair[0]; i < n; i++) vv.push_back(v[i]);
  for (long long i = 0; i < make_pair[0]; i++) vv.push_back(v[i]);
  v = vv;
  vector<long long> ans(n, 0), ans1(n, 0);
  for (long long i = 1; i < n; i++) {
    long long prev = query(0, 0, n - 1, 0, v[i] - 2);
    long long qq = query_tree(0, 0, n - 1, prev, prev);
    update(0, 0, n - 1, v[i] - 1, i);
    if (prev + 1 <= i - 1) update_tree(0, 0, n - 1, prev + 1, i - 1, 1);
    update_tree(0, 0, n - 1, i, i, qq + 1);
    ans[i] = query_tree(0, 0, n - 1, 0, i);
  }
  reverse(v.begin() + 1, v.end());
  for (long long i = 0; i <= 800004; i++) seg[i] = lazy[i] = tree[i] = 0;
  for (long long i = 1; i < n; i++) {
    long long prev = query(0, 0, n - 1, 0, v[i] - 2);
    long long qq = query_tree(0, 0, n - 1, prev, prev);
    update(0, 0, n - 1, v[i] - 1, i);
    if (prev + 1 <= i - 1) update_tree(0, 0, n - 1, prev + 1, i - 1, 1);
    update_tree(0, 0, n - 1, i, i, qq + 1);
    ans1[i] = query_tree(0, 0, n - 1, 0, i);
  }
  long long ff = 1000000000000000000LL;
  long long mnx = -1;
  for (long long i = 0; i < n; i++) {
    if (max(ans[i], ans1[n - 1 - i]) < ff) {
      ff = max(ans[i], ans1[n - 1 - i]);
      mnx = i + 1;
    }
  }
  mnx += make_pair[0];
  mnx %= n;
  cout << ff + 1 << " " << mnx;
}