#include <iostream>
#define INF 2147000000
using namespace std;
int v[1005],n,i,minn=INF,maxx=-INF,imin,imax;
int main()
{
cin>>n;
for(i=1;i<=n;i++)
{
cin>>v[i];
if(v[i]<minn) minn=v[i],imin=i;
if(v[i]>maxx) maxx=v[i],imax=i;
}
cout<<imin<<" "<<imax;
return 0;
}