#include <iostream>
#include <vector>
using namespace std;
int main()
{
	vector<int> choice;
	int n;
	cin >> n;
	for(int i = 0;i < n;i ++)
	{
		int pusher;
		cin >> pusher;
		choice.push_back(pusher);
	}
	int max = 0, maxman = 0;
	for(int i = 0;i < n;i ++)
	{
		int fromstart = 1, getindex = i, happy = 0;
		for(;fromstart < n + 1;fromstart ++)
		{
			if(fromstart == choice[getindex])
			{
				happy ++;
			}
			if(getindex + 1 > n - 1)
			{
				getindex = 0;
			}
			else
			{
				getindex ++;
			}

		}
		if(happy > max)
		{
			max = happy;
			maxman = i;
		}
	}
	cout << maxman + 1 << endl;
	return 0;
}
