#include <iostream>
#include <fstream>
using namespace std;

int main()
{   ifstream f1("TIMMAX.INP");
    int i,n;
    f1>>n;
    long long a[10000];
    for (i=1;i<=n;i++)
    {
        f1>>a[i];
    }
    f1.close();
    int max=a[1];
    ofstream f2 ("TIMMAX.OUT");
    for (i=1;i<=n;i++)
    {if (max<a[i])
    {
        max=a[i];
    }}
    f2<<max<<endl;
   for (i=1;i<=n;i++)
   {if (a[i]==max)
    {f2<<i<<" ";}}



    return 0;
}
