#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int inf = 1e9;
int main() {
  double N;
  cin >> N;
  vector<double> a(N);
  double asum = 0;
  for (int i = 0; i < int(N); ++i) {
    cin >> a[i];
    asum += a[i];
  }
  asum /= N;
  for (int i = 0; i < int(N); ++i) a[i] = abs(a[i] - asum);
  int d = inf, ans;
  for (int i = 0; i < int(N); ++i) {
    if (d > a[i]) {
      d = a[i];
      ans = i;
    }
  }
  for (int i = 0; i < int(N); ++i) cout << a[i] << endl;
  cout << ans << endl;
}
