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;
constexpr int MOD = 1e9 + 7;
constexpr int INF = INT32_MAX;
constexpr int MAXN = 2e5 + 10;
constexpr double eps = 1e-8;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
using Vec = vector<int>;
template <class T>
void Min(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
void Max(T &a, T b) {
  if (b > a) a = b;
}
ll N, M, K, T;
Vec pre_max, pre_min;
Vec nxt_max, nxt_min;
Vec A;
Vec c;
int t[MAXN * 4], add[MAXN * 4];
void Build(int v, int l, int r) {
  if (l == r) {
    t[v] = c[l];
    return;
  }
  int m = (l + r) >> 1;
  Build(v * 2, l, m);
  Build(v * 2 + 1, m + 1, r);
  t[v] = max(t[v * 2], t[v * 2 + 1]);
}
void Push(int v, int l, int r) {
  if (l == r) return;
  if (add[v] != 0) {
    add[v * 2] += add[v];
    add[v * 2 + 1] += add[v];
    t[v * 2] += add[v];
    t[v * 2 + 1] += add[v];
    add[v] = 0;
  }
}
void Upd(int v, int l, int r, int L, int R, int val) {
  Push(v, l, r);
  if (l > R || r < L) return;
  if (L <= l && r <= R) {
    t[v] += val;
    add[v] += val;
    return;
  }
  int m = (l + r) / 2;
  Upd(v * 2, l, m, L, R, val);
  Upd(v * 2 + 1, m + 1, r, L, R, val);
  t[v] = max(t[v * 2], t[v * 2 + 1]);
}
int Qry(int v, int l, int r, int p) {
  Push(v, l, r);
  if (l == p && r == p) return t[v];
  int m = (l + r) / 2;
  if (p <= m) {
    return Qry(v * 2, l, m, p);
  } else {
    return Qry(v * 2 + 1, m + 1, r, p);
  }
}
void Solution() {
  for (int i = (int)(0); i < (int)(N); ++i) A.emplace_back(A[i]);
  pre_max.assign(N, -1);
  pre_min.assign(N, -1);
  nxt_max.assign(N, -1);
  nxt_min.assign(N, -1);
  for (int i = (int)(1); i < (int)(2 * N); ++i) {
    if (A[i - 1] < A[i]) {
      pre_min[i % N] = (i - 1) % N;
    } else {
      int j = pre_min[(i - 1) % N];
      while (j != -1 && A[j] > A[i]) {
        j = pre_min[j];
      }
      if (j == -1 || A[i] == A[j])
        pre_min[i % N] = -1;
      else
        pre_min[i % N] = j;
    }
  }
  for (int i = (int)(2 * N - 2); i >= (int)(0); --i) {
    if (A[i + 1] < A[i]) {
      nxt_min[i % N] = (i + 1) % N;
    } else {
      int j = nxt_min[(i + 1) % N];
      while (j != -1 && A[j] > A[i]) {
        j = nxt_min[j];
      }
      if (j == -1 || A[i] == A[j])
        nxt_min[i % N] = -1;
      else
        nxt_min[i % N] = j;
    }
  }
  c.assign(N, 0);
  Vec a(N, 0), b(N, 0);
  for (int i = (int)(0); i < (int)(N); ++i) {
    int j = pre_min[i];
    if (j == -1 || j == i) continue;
    if (j < i) {
      a[i] = a[j] + 1;
    }
  }
  for (int i = (int)(N - 1); i >= (int)(0); --i) {
    int j = nxt_min[i];
    if (j == -1 || j == i) continue;
    if (j > i) {
      b[i] = b[j] + 1;
    }
  }
  for (int i = (int)(0); i < (int)(N); ++i) c[i] = a[i] + b[i];
  Build(1, 0, N - 1);
  int ans = t[1];
  int shift = 0;
  for (int i = (int)(1); i < (int)(N); ++i) {
    int j = nxt_min[i - 1];
    if (j == -1 || j == i - 1) {
      continue;
    } else {
      if (j > i - 1)
        Upd(1, 0, N - 1, i, j - 1, -1);
      else {
        Upd(1, 0, N - 1, i, N - 1, -1);
        Upd(1, 0, N - 1, 0, j - 1, -1);
      }
    }
    j = pre_min[i - 1];
    if (j < i - 1) {
      Upd(1, 0, N - 1, j + 1, i - 2, 1);
    } else {
      Upd(1, 0, N - 1, 0, i - 2, 1);
      Upd(1, 0, N - 1, j + 1, N - 1, 1);
    }
    int v1 = Qry(1, 0, N - 1, j);
    int v2 = Qry(1, 0, N - 1, i - 1);
    Upd(1, 0, N - 1, i - 1, i - 1, v1 + 1 - v2);
    if (ans > t[1]) {
      ans = t[1];
      shift = i;
    }
  }
  cout << ans + 1 << ' ' << shift << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  while (cin >> N) {
    A.resize(N);
    for (int i = (int)(0); i < (int)(N); ++i) cin >> A[i];
    Solution();
  }
  return 0;
}