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 long double pi = 3.1415926535897932384626433832795l;
template <typename T>
inline auto sqr(T x) -> decltype(x * x) {
  return x * x;
}
template <typename T>
inline T abs(T x) {
  return x > T() ? x : -x;
}
template <typename T1, typename T2>
inline bool umx(T1& a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool umn(T1& a, T2 b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
class RangeQuerySolver {
 public:
  RangeQuerySolver() {}
  virtual int fnd(int l, int r) = 0;
};
class SegmentTree : public RangeQuerySolver {
 public:
  SegmentTree(vector<int> a) {
    sz = 1;
    int n = ((int)(a).size());
    while (sz < n) sz <<= 1;
    addend.assign(2 * sz, 0);
    saved_a = a;
  }
  void init() {
    t.assign(2 * sz, default_value());
    for (int i = int(0); i < int(((int)(saved_a).size())); ++i) {
      t[i + sz] = saved_a[i];
    }
    for (int i = int(sz) - 1; i >= int(1); --i) {
      t[i] = relax(t[2 * i], t[2 * i + 1]);
    }
  }
  virtual int default_value() = 0;
  virtual int relax(int botva, int sdkfjsokdf) = 0;
  void push(int v) {
    if (v >= 2 * sz) {
      return;
    }
    t[v] += addend[v];
    if (v < sz) {
      addend[2 * v] += addend[v];
      addend[2 * v + 1] += addend[v];
    }
    addend[v] = 0;
  }
  void add(int l, int r, int k) {
    if (l > r) {
      return;
    }
    upd(1, 0, sz - 1, l, r, k);
  }
  void upd(int i, int k) {
    int res = fnd(i, i);
    add(i, i, k - res);
  }
  void upd(int i, int x, int y, int l, int r, int k) {
    push(i);
    if (x > r || y < l) {
      return;
    }
    if (x >= l && y <= r) {
      addend[i] += k;
      push(i);
      return;
    }
    upd(2 * i, x, (x + y) >> 1, l, r, k);
    upd(2 * i + 1, ((x + y) >> 1) + 1, y, l, r, k);
    if (i < sz) {
      t[i] = relax(t[2 * i], t[2 * i + 1]);
    }
  }
  int fnd(int l, int r) override { return fnd(1, 0, sz - 1, l, r); }
  int fnd(int i, int x, int y, int l, int r) {
    push(i);
    if (x > r || y < l) {
      return default_value();
    }
    if (x >= l && y <= r) {
      return t[i];
    }
    return relax(fnd(2 * i, x, (x + y) >> 1, l, r),
                 fnd(2 * i + 1, ((x + y) >> 1) + 1, y, l, r));
  }

 protected:
  vector<int> t;
  vector<int> saved_a;
  vector<int> addend;
  int sz;
};
class MinTree : public SegmentTree {
 public:
  MinTree(vector<int> a) : SegmentTree(a) {}
  int default_value() override { return (1 << 30); }
  int relax(int botva, int sdkfjsokdf) { return min(botva, sdkfjsokdf); }
};
class MaxTree : public SegmentTree {
 public:
  MaxTree(vector<int> a) : SegmentTree(a) {}
  int default_value() override { return 0; }
  int relax(int botva, int sdkfjsokdf) { return max(botva, sdkfjsokdf); }
};
class SlowMinimumQuerySolver : public RangeQuerySolver {
 public:
  SlowMinimumQuerySolver(vector<int> a) : a(a) {}
  int fnd(int l, int r) override {
    int minn = a[l];
    for (int i = l + 1; i <= r; ++i) {
      umn(minn, a[i]);
    }
    return minn;
  }

 private:
  vector<int> a;
};
void build_tree(int l, int r, int dist, vector<int>& a, const vector<int>& posp,
                RangeQuerySolver& tree) {
  if (r < l) {
    return;
  }
  int val = tree.fnd(l, r);
  int pos = posp[val];
  a[pos] = dist;
  build_tree(l, pos - 1, dist + 1, a, posp, tree);
  build_tree(pos + 1, r, dist + 1, a, posp, tree);
}
struct Input {
  int n;
  vector<int> p;
  vector<int> posp;
  bool read() {
    if (scanf("%d", &n) != 1) {
      return 0;
    }
    p.resize(n);
    posp.resize(n);
    for (int i = int(0); i < int(n); ++i) {
      cin >> p[i];
      --p[i];
      posp[p[i]] = i;
    }
    return 1;
  }
  void gen() {
    n = 5;
    p = vector<int>(n);
    for (int i = int(0); i < int(n); ++i) {
      p[i] = i;
    }
    random_shuffle((p).begin(), (p).end());
    posp = vector<int>(n);
    for (int i = int(0); i < int(n); ++i) {
      posp[p[i]] = i;
    }
  }
  void init(const Input& input) { *this = input; }
};
struct Data : Input {
  pair<int, int> ans;
  void write() { cout << ans.first << ' ' << ans.second << "\n"; }
  virtual void solve() {}
  virtual void clear() { *this = Data(); }
};
struct CleverSolution : Data {
  vector<int> botva, sdkfjsokdf;
  void solve() {
    vector<int> a(n);
    MinTree min_tree(p);
    min_tree.init();
    build_tree(0, n - 1, 0, a, posp, min_tree);
    MaxTree max_tree(a);
    max_tree.init();
    ans.first = max_tree.fnd(0, n - 1);
    ans.second = 0;
    set<int> s;
    botva.resize(n);
    sdkfjsokdf.resize(n);
    for (int i = int(0); i < int(n); ++i) {
      if (i == 0) {
        botva[posp[i]] = sdkfjsokdf[posp[i]] = -1;
        s.insert(posp[i]);
        continue;
      }
      s.insert(posp[i]);
      if (*s.begin() != posp[i]) {
        botva[posp[i]] = *(--s.lower_bound(posp[i]));
      } else {
        botva[posp[i]] = *(--s.end());
      }
      if (*(--s.end()) != posp[i]) {
        sdkfjsokdf[posp[i]] = *(s.upper_bound(posp[i]));
      } else {
        sdkfjsokdf[posp[i]] = *s.begin();
      }
    };
    ;
    for (int i = int(0); i < int(n); ++i) {
      if (p[i] == 0) {
        continue;
      }
      if (sdkfjsokdf[i] < i) {
        max_tree.add(0, sdkfjsokdf[i] - 1, -1);
        max_tree.add(i + 1, n - 1, -1);
      } else {
        max_tree.add(i + 1, sdkfjsokdf[i] - 1, -1);
      }
      max_tree.upd(i, max_tree.fnd(botva[i], botva[i]) + 1);
      if (botva[i] > i) {
        max_tree.add(0, i - 1, 1);
        max_tree.add(botva[i] + 1, n - 1, 1);
      } else {
        max_tree.add(botva[i] + 1, i - 1, 1);
      }
      if (umn(ans.first, max_tree.fnd(0, n - 1))) {
        ans.second = i + 1;
      }
    }
    ++ans.first;
  }
  void clear() { *this = CleverSolution(); }
};
struct StupidSolution : Data {
  void solve() {
    ans = make_pair(1 << 30, -1);
    for (int i = int(0); i < int(n); ++i) {
      vector<int> a(n);
      SlowMinimumQuerySolver solver(p);
      build_tree(0, n - 1, 0, a, posp, solver);
      ;
      pair<int, int> res = make_pair(-1, -1);
      for (int j = int(0); j < int(n); ++j) {
        if (res.first < a[j]) {
          res = make_pair(a[j], i);
        }
      }
      umn(ans, res);
      int p0 = p[0];
      for (int j = int(0); j < int(((int)(p).size()) - 1); ++j) {
        p[j] = p[j + 1];
      }
      p[n - 1] = p0;
      for (int j = int(0); j < int(n); ++j) {
        posp[p[j]] = j;
      }
    }
    ++ans.first;
  }
  void clear() { *this = StupidSolution(); }
};
CleverSolution clever_sol;
StupidSolution stupid_sol;
int main() {
  cout.setf(ios::showpoint | ios::fixed);
  cout.precision(20);
  clever_sol.read();
  clever_sol.solve();
  clever_sol.write();
  return 0;
}