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;
const int MAXN = 4e5 + 2;
int dep_tree[MAXN * 4];
int add_down[MAXN * 4];
void push(int v) {
  dep_tree[v] += add_down[v];
  if (v * 2 < MAXN * 4) {
    add_down[v * 2] += add_down[v];
    add_down[v * 2 + 1] += add_down[v];
  }
  add_down[v] = 0;
}
void add_val(int v, int l, int r, int ql, int qr, int val) {
  if (l >= qr || r <= ql) return;
  push(v);
  if (ql <= l && qr >= r) {
    add_down[v] += val;
    push(v);
    return;
  }
  int m = (l + r) / 2;
  add_val(v * 2, l, m, ql, qr, val);
  add_val(v * 2 + 1, m, r, ql, qr, val);
  dep_tree[v] = max(dep_tree[v * 2], dep_tree[v * 2 + 1]);
}
int get_max(int v, int l, int r, int ql, int qr) {
  if (l >= qr || r <= ql) {
    return 0;
  }
  push(v);
  if (ql <= l && qr >= r) {
    return dep_tree[v];
  }
  int m = (l + r) / 2;
  auto left = get_max(v * 2, l, m, ql, qr);
  auto right = get_max(v * 2 + 1, m, r, ql, qr);
  return max(left, right);
}
struct node {
  int prior, ind;
  node *left = nullptr;
  node *right = nullptr;
  node *par = nullptr;
  node(int prior, int ind) {
    this->prior = prior;
    this->ind = ind;
  }
  int get_dep() { return get_max(1, 0, MAXN, this->ind, this->ind + 1); }
};
void set_right(node *par, node *ch) {
  if (par) par->right = ch;
  if (ch) ch->par = par;
}
void set_left(node *par, node *ch) {
  if (par) par->left = ch;
  if (ch) ch->par = par;
}
node *add_back(node *n, node *root, node *new_node, int start) {
  if (!n) return new_node;
  if (n->prior < new_node->prior) {
    set_right(n, new_node);
    int dep = n->get_dep() + 1;
    add_val(1, 0, MAXN, new_node->ind, new_node->ind + 1, dep);
    return root;
  }
  while (n->par && n->par->prior > new_node->prior) n = n->par;
  int from = start;
  if (!n->par) {
    root = new_node;
  } else {
    set_right(n->par, new_node);
    int dep = n->get_dep();
    add_val(1, 0, MAXN, new_node->ind, new_node->ind + 1, dep);
    from = n->par->ind + 1;
  }
  set_left(new_node, n);
  add_val(1, 0, MAXN, from, new_node->ind, 1);
  return root;
}
node *remove_front(node *n, node *root, int fin) {
  if (n == root) {
    add_val(1, 0, MAXN, 0, fin, -1);
    n->right->par = nullptr;
    return n->right;
  }
  set_left(n->par, n->right);
  add_val(1, 0, MAXN, n->ind, n->par->ind, -1);
  return root;
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<node *> nodes(n);
  node *root = nullptr, *last = nullptr;
  for (int i = 0; i < n; i++) {
    nodes[i] = new node(a[i], i);
    root = add_back(last, root, nodes[i], 0);
    last = nodes[i];
  }
  int min_dep = get_max(1, 0, MAXN, 0, n), shift = 0;
  for (int i = 0; i < n - 1; i++) {
    root = remove_front(nodes[i], root, n + i);
    nodes[i]->ind = n + i;
    nodes[i]->left = nodes[i]->right = nodes[i]->par = nullptr;
    root = add_back(last, root, nodes[i], i + 1);
    last = nodes[i];
    int dep = get_max(1, 0, MAXN, i + 1, i + n + 1);
    if (dep < min_dep) {
      min_dep = dep;
      shift = i + 1;
    }
  }
  cout << min_dep + 1 << ' ' << shift << endl;
}