void main()
{
    int n = readln.chomp.to!int;
    int[] a = readln.split.to!(int[]);

    double m = a.sum / n.to!double;
    double diff = double.max;
    ulong frame;
    foreach (i, x; a)
    {
        if (abs(x.to!double - m) < diff)
        {
            frame = i;
            diff = abs(x.to!double - m);
        }
    }

    frame.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;