#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); i++)

int main(){

    int n;
    cin >> n;
    int a[n];
    double ave = 0;
    rep(i,n) {
        cin >> a[i];
        ave += a[i];
    }
    ave /= n;
    double d = 1e5;
    int ans = 0;
    rep(i,n){
        if(d > abs(ave-a[i])){
            ans = i;
            d = abs(ave-a[i]);
        }
    }

    
    cout << ans << endl;

    return 0;
}
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;


int dp[34];
int main(){
int N,x;

  cin >> x;
  dp[0] = 1;
  for(int i = 0; i < 31; i++){

	  dp[i+1] += dp[i];
	  dp[i+2] += dp[i];
	  dp[i+3] += dp[i];

  }

  while(x != 0){

	  cout << dp[x]/3650 + 1 << endl;;

	  cin >> x;
  }


    


	return 0;
}