#include <bits/stdc++.h>
using namespace std;
int val[110], sum;
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> val[i];
    sum += val[i];
  }
  int Bin = -1, Bx = 100000;
  for (int i = 0; i < N; i++)
    if (abs(val[i] * N - sum) < Bx) {
      Bx = abs(val[i] * N - sum);
      Bin = i;
    }
  cout << sum << " " << Bin << endl;
  return 0;
}
