#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<double> a(n);
  double sum = 0;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    sum += a[i];
  }
  double k = sum / n;
  double mi = 100000;
  int ans = 0;
  for (int i = 0; i < (n); ++i) {
    if (mi > abs(a[i] - k)) {
      mi = abs(a[i] - k);
      ans = i;
    }
    cout << mi << endl;
  }
  cout << ans << endl;
  return 0;
}
