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;
using ll = long long;
using vi = vector<int>;
using pi = pair<int, int>;
struct Node {
  int f, g;
};
const int nax = 200 * 1000 + 10, INF = 1e9;
int n;
int a[2 * nax];
int nxtl[nax], nxtr[nax], inv[nax];
Node T[(1 << 20)];
set<int> pos;
void propagate(int x) {
  T[2 * x].g += T[x].g;
  T[2 * x + 1].g += T[x].g;
  T[x].g = 0;
}
void update(int a, int b, int x, int v, int l, int r) {
  if (a <= l && r <= b) {
    T[v].g += x;
    return;
  }
  propagate(v);
  int mid = (l + r) / 2;
  if (a <= mid) update(a, b, x, v * 2, l, mid);
  if (mid < b) update(a, b, x, v * 2 + 1, mid + 1, r);
  T[v].f = max(T[2 * v].f + T[2 * v].g, T[2 * v + 1].f + T[2 * v + 1].g);
}
int query(int a, int b, int v, int l, int r) {
  if (a <= l && r <= b) {
    return T[v].f + T[v].g;
  }
  propagate(v);
  int mid = (l + r) / 2;
  int w = -1;
  if (a <= mid) w = max(w, query(a, b, v * 2, l, mid));
  if (mid < b) w = max(w, query(a, b, v * 2 + 1, mid + 1, r));
  T[v].f = max(T[2 * v].f + T[2 * v].g, T[2 * v + 1].f + T[2 * v + 1].g);
  return w;
}
pi ans = {INF, -1};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    a[i + n] = a[i];
    inv[a[i]] = i;
  }
  vi S = {2 * n + 1};
  for (int i = n; i >= 1; --i) {
    while (a[S.back()] > a[i]) S.pop_back();
    nxtr[i + n] = S.back();
    S.push_back(i + n);
  }
  for (int i = n; i >= 1; --i) {
    while (a[S.back()] > a[i]) S.pop_back();
    nxtr[i] = S.back();
    S.push_back(i);
  }
  S = {0};
  for (int i = 1; i <= n; i++) {
    while (a[S.back()] > a[i]) S.pop_back();
    S.push_back(i);
  }
  for (int i = n + 1; i <= 2 * n; i++) {
    while (a[S.back()] > a[i]) S.pop_back();
    nxtl[i] = S.back();
    S.push_back(i);
  }
  pos.insert(0);
  pos.insert(n + 1);
  for (int i = 1; i <= n; i++) {
    auto it = pos.lower_bound(inv[i]);
    it--;
    int x = (*it);
    it++;
    int y = (*it);
    update((x) + 1, y - 1, 1, 1, 1, 2 * n);
    pos.insert(inv[i]);
  }
  for (int i = 0; i < n; i++) {
    int w = query(i + 1, n + i, 1, 1, 2 * n);
    ans = min(ans, {w, i});
    update(i + 1, nxtr[i + 1] - 1, -1, 1, 1, 2 * n);
    update(nxtl[i + 1 + n] + 1, i + 1 + n, 1, 1, 1, 2 * n);
    int val = query(nxtl[i + 1 + n], nxtl[i + 1 + n], 1, 1, 2 * n);
    update(i + 1 + n, i + 1 + n, val, 1, 1, 2 * n);
  }
  cout << ans.first << " " << ans.second;
}