#include <iostream>
#include <fstream>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
	long int max=0;
	int n,i;
	long int a[10000];
	int vt=0;
	ifstream fi("TIMMAX.inp");
    fi>>n;
	ofstream fo("TIMMAX.out");
	for(i=0;i<=n-1;i++)
	{
		fi>>a[i];
		if (max<a[i])
		{
			max=a[i];
			vt=i;
		}
	}
	fi.close();
	fo<<max<<endl;
	for(i=0;i<=n-1;i++)
	{
		if(a[i]==max)
		{
			vt=i;
			fo<<vt+1<<" ";
		}
	}			
	fo.close();
}
