#include <iostream>
#include <fstream>
using namespace std;
int main()
{
	ifstream f("timmax.inp");
	int i;
	long long a[99999],max=-1000000,n;
	f>>n;
	for (i=1;i<=n;i++)
	{f>>a[i];
	}
	for (i=1;i<=n;i++)
	{
		if (a[i]>max)
		{
			max=a[i];
		}
	}
	f.close();	
		ofstream f1("timmax.out");
		f1<<max<<'\n';
		for (i=1;i<=n;i++)
		{
		if (a[i]==max)
		{
			f1<<i;
		}
	}
	f1.close();
}
}
