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;
void per() { cerr << endl; }
template <typename Head, typename... Tail>
void per(Head H, Tail... T) {
  cerr << H << ' ';
  per(T...);
}
template <class T>
bool uin(T& a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T& a, T b) {
  return a < b ? (a = b, true) : false;
}
template <class U, class V>
ostream& operator<<(ostream& out, const pair<U, V>& a) {
  return out << "(" << a.first << ", " << a.second << ")";
}
template <class U, class V>
istream& operator>>(istream& in, pair<U, V>& a) {
  return in >> a.first >> a.second;
}
template <typename W,
          typename T = typename enable_if<!is_same<W, string>::value,
                                          typename W::value_type>::type>
ostream& operator<<(ostream& out, const W& v) {
  out << "{ ";
  for (const auto& first : v) out << first << ", ";
  return out << '}';
}
template <class T>
void readArr(T from, T to) {
  for (auto i = from; i != to; ++i) cin >> *i;
}
mt19937 mrand(1337);
unsigned int myRand32() { return mrand() & (unsigned int)(-1); }
unsigned long long myRand64() {
  return ((unsigned long long)myRand32() << 32) ^ myRand32();
}
const int mod = 1000000007;
void add(int& a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
void dec(int& a, int b) {
  a -= b;
  if (a < 0) a += mod;
}
int mult(int a, int b) { return a * (long long)b % mod; }
int bp(int a, int b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) res = mult(res, a);
    a = mult(a, a);
    b >>= 1;
  }
  return res;
}
struct Tree {
  int t[400007 * 4];
  int p[400007 * 4];
  void push(int v) {
    if (p[v]) {
      t[v] += p[v];
      if (v * 2 + 1 < 400007 * 4) p[v * 2 + 1] += p[v];
      if (v * 2 + 2 < 400007 * 4) p[v * 2 + 2] += p[v];
      p[v] = 0;
    }
  }
  void add(int v, int vl, int vr, int l, int r, int val) {
    push(v);
    if (l > r) return;
    if (r < vl || l > vr) return;
    if (vl >= l && vr <= r) {
      p[v] += val;
      push(v);
    } else {
      int vm = (vl + vr) >> 1;
      add(v * 2 + 1, vl, vm, l, r, val);
      add(v * 2 + 2, vm + 1, vr, l, r, val);
      t[v] = max(t[v * 2 + 1], t[v * 2 + 2]);
    }
  }
  int get(int v, int vl, int vr, int l, int r) {
    if (r < vl || l > vr) return -1;
    if (vl >= l && vr <= r) return t[v];
    int vm = (vl + vr) >> 1;
    return max(get(v * 2 + 1, vl, vm, l, r), get(v * 2 + 2, vm + 1, vr, l, r));
  }
} tr;
struct Tree2 {
  pair<int, int> t[400007 * 4];
  void up(int v, int vl, int vr, int pos, int val) {
    if (vl == vr) {
      t[v] = make_pair(val, vl);
    } else {
      int vm = (vl + vr) >> 1;
      if (pos <= vm)
        up(v * 2 + 1, vl, vm, pos, val);
      else
        up(v * 2 + 2, vm + 1, vr, pos, val);
      t[v] = min(t[v * 2 + 1], t[v * 2 + 2]);
    }
  }
  pair<int, int> get(int v, int vl, int vr, int l, int r) {
    if (r < vl || l > vr) return make_pair(1e9, -1);
    if (vl >= l && vr <= r) return t[v];
    int vm = (vl + vr) >> 1;
    return min(get(v * 2 + 1, vl, vm, l, r), get(v * 2 + 2, vm + 1, vr, l, r));
  }
} f2;
int n;
int a[400007];
void build(int vl, int vr) {
  if (vl != vr) {
    auto [_, vm] = f2.get(0, 0, n, vl, vr);
    if (vl < vm) tr.add(0, 0, 2 * n, vl, vm - 1, 1), build(vl, vm - 1);
    if (vm + 1 <= vr) tr.add(0, 0, 2 * n, vm + 1, vr, 1), build(vm + 1, vr);
  }
}
int prv[400007];
int nxt[400007];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  readArr(a, a + n);
  for (int i = 0; i < n; ++i) --a[i], f2.up(0, 0, n, i, a[i]);
  copy(a, a + n, a + n);
  int best = 1e9, best_pos = -1;
  fill(prv, prv + 400007, -1);
  fill(nxt, nxt + 400007, -1);
  vector<pair<int, int> > st;
  for (int i = 0; i < n * 2; ++i) {
    while (st.size()) {
      if (st.back().first >= a[i])
        st.pop_back();
      else {
        prv[i] = st.back().second;
        break;
      }
    }
    st.push_back(make_pair(a[i], i));
  }
  st.clear();
  for (int i = 2 * n - 1; i >= 0; --i) {
    while (st.size()) {
      if (st.back().first >= a[i])
        st.pop_back();
      else {
        nxt[i] = st.back().second;
        break;
      }
    }
    st.push_back(make_pair(a[i], i));
  }
  build(0, n - 1);
  for (int i = 0; i < n; ++i) {
    auto now = tr.get(0, 0, 2 * n, i, i + n - 1);
    if (now < best) {
      best = now;
      best_pos = i;
    }
    if (a[i] == 0) continue;
    int nx = nxt[i];
    int pr = prv[i + n];
    tr.add(0, 0, 2 * n, i + 1, nx - 1, -1);
    tr.add(0, 0, 2 * n, pr + 1, i + n - 1, 1);
    tr.add(0, 0, 2 * n, i + n, i + n, tr.get(0, 0, 2 * n, pr, pr) + 1);
  }
  cout << best + 1 << ' ' << best_pos;
}