#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, sum = 0;
  cin >> N;
  int a[N];
  vector<pair<int, int> > hoge;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  double avg = sum / (double)N;
  for (int i = 0; i < N; ++i) {
    hoge.push_back(make_pair(abs(a[i] - avg), i));
  }
  sort(hoge.begin(), hoge.end());
  cout << "avg: " << avg << endl;
  cout << hoge[0].second << endl;
}
