public static ArrayList All_idx(int n,int a[],int m,int i)
{
if(i==a.length)
{
ArrayList bs=new ArrayList<>();
return bs;
}
ArrayList ans=new ArrayList<>();
ArrayList aa=All_idx(n, a, m, i+1);
if(a[i]==m)
{
aa.add(i);
}
ans=aa;
return ans;
}
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
// String str;
// str=sc.nextLine();
//
// System.out.println(Pi_rem(str));
int n=sc.nextInt();
int a[]=new int[n];
for(int i=0;i<n;i++)
{
a[i]=sc.nextInt();
}
int m=sc.nextInt();
ArrayList<Integer> aa=All_idx(n, a, m, 0);
Collections.reverse(aa);
System.out.println(aa);
}
}