#include <stdio.h>
int main(){int n;scanf("%d",&n);int s[n];for(int i = 0 ; i < n ; i++)scanf("%d",&s[i]);int k;scanf("%d",&k);int sum = 0;int t=0,h;int st[101]; for(int i = 0 ; i < n ; i++)st[i] =0; //标记数组 找到最小的 标记for(int j=0,i=j+1;i<n;) // 双指针思想 { if(s[j] + s[i] == k){st[j]=i; }if(i+1==n){j++;i = j + 1;}i++;}for(int i = 0 ; i < n ; i++)if(st[i]) {printf("%d %d",i,st[i]);break;}return 0;
}