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;
int inline read() {
  int num = 0, neg = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    num = (num << 3) + (num << 1) + c - '0';
    c = getchar();
  }
  return num * neg;
}
const int maxn = 400010, mod = 998244353;
int n, a[maxn], stk[maxn], tp, fa[maxn], LS[maxn], RS[maxn], dep[maxn];
void dfs(int x) {
  if (LS[x]) {
    dep[LS[x]] = dep[x] + 1;
    dfs(LS[x]);
  }
  if (RS[x]) {
    dep[RS[x]] = dep[x] + 1;
    dfs(RS[x]);
  }
}
int f[maxn][20], lg2[maxn];
void init() {
  lg2[0] = -1;
  for (int i = 1; i <= 2 * n; i++) f[i][0] = i;
  for (int i = 1; i <= 2 * n; i++) lg2[i] = lg2[i >> 1] + 1;
  for (int i = 1; i <= lg2[2 * n]; i++)
    for (int j = 1; j + (1 << i) - 1 <= 2 * n; j++)
      if (a[f[j][i - 1]] < a[f[j + (1 << i - 1)][i - 1]])
        f[j][i] = f[j][i - 1];
      else
        f[j][i] = f[j + (1 << i - 1)][i - 1];
}
int Q(int l, int r) {
  int len = r - l + 1;
  len = lg2[len];
  if (a[f[l][len]] < a[f[r - (1 << len) + 1][len]]) return a[f[l][len]];
  return a[f[r - (1 << len) + 1][len]];
}
int mx[maxn << 2], lzy[maxn << 2];
void pushup(int x) { mx[x] = max(mx[(x << 1)], mx[(x << 1 | 1)]); }
void Build(int x, int l, int r) {
  if (l == r) {
    mx[x] = dep[l];
    return;
  }
  int mid = l + r >> 1;
  Build((x << 1), l, mid);
  Build((x << 1 | 1), mid + 1, r);
  pushup(x);
}
void pushdown(int x) {
  if (!lzy[x]) return;
  mx[(x << 1)] += lzy[x];
  mx[(x << 1 | 1)] += lzy[x];
  lzy[(x << 1)] += lzy[x];
  lzy[(x << 1 | 1)] += lzy[x];
  lzy[x] = 0;
}
void update(int x, int l, int r, int L, int R, int k, int op) {
  if (L > R) return;
  if (l >= L && r <= R) {
    if (op) {
      mx[x] += k;
      lzy[x] += k;
    } else
      mx[x] = k;
    return;
  }
  int mid = l + r >> 1;
  pushdown(x);
  if (mid >= L) update((x << 1), l, mid, L, R, k, op);
  if (mid < R) update((x << 1 | 1), mid + 1, r, L, R, k, op);
  pushup(x);
}
int Query(int x, int l, int r, int pos) {
  if (l == r) return mx[x];
  int mid = l + r >> 1;
  pushdown(x);
  if (mid >= pos) return Query((x << 1), l, mid, pos);
  return Query((x << 1 | 1), mid + 1, r, pos);
}
void upd(int l, int r, int k) {
  if (l > r) return;
  update(1, 1, 2 * n, l, r, k, 1);
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= n; i++) {
    while (tp && a[stk[tp]] > a[i]) LS[i] = stk[tp], tp--;
    fa[i] = stk[tp];
    if (LS[i]) fa[LS[i]] = i;
    if (tp) RS[stk[tp]] = i;
    stk[++tp] = i;
  }
  for (int i = 1; i <= n; i++) a[i + n] = a[i];
  for (int i = 1; i <= n; i++)
    if (fa[i] == 0) dep[i] = 1, dfs(i);
  init();
  Build(1, 1, 2 * n);
  int ans = mx[1], pos = 0;
  for (int i = 1; i < n; i++) {
    int l = i + 1, r = i + n - 1, flg = 0;
    while (l < r) {
      int mid = l + r >> 1;
      if (Q(i + 1, mid) < a[i])
        r = mid, flg = 1;
      else
        l = mid + 1;
    }
    flg |= Q(i + 1, l) < a[i];
    if (flg)
      upd(i + 1, l - 1, -1);
    else
      upd(i + 1, i + n - 1, -1);
    l = i + 1;
    r = i + n - 1;
    flg = 0;
    while (l < r) {
      int mid = l + r + 1 >> 1;
      if (Q(mid, i + n - 1) < a[i])
        l = mid, flg = 1;
      else
        r = mid - 1;
    }
    flg |= Q(l, i + n - 1) < a[i];
    int len;
    if (flg)
      len = Query(1, 1, 2 * n, l);
    else
      len = 0;
    update(1, 1, 2 * n, i + n, i + n, len + 1, 0);
    update(1, 1, 2 * n, i, i, 0, 0);
    if (flg)
      upd(l + 1, i + n - 1, 1);
    else
      upd(i + 1, i + n - 1, 1);
    if (mx[1] < ans) ans = mx[1], pos = i;
  }
  cout << ans << " " << pos;
  return 0;
}