#include <fstream>

using namespace std;

int main(){
  long long n,a[100000];
   ifstream fi;
  fi.open("TIMMAX.INP");
  fi>>n;
  for (int i=0;i<n;i++){fi>>a[i];}
  fi.close();
  long long max = a[0];
  for (int k=1;k<n;k++){if (a[k]>max){max=a[k];}}
  ofstream fo;
  fo.open("TIMMAX.OUT");
  fo<<max<<endl;
  for (int g=0;g<n;g++){if (a[g]==max){fo<<g+1<<" ";}}
}
