#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define ll long long
#define vi vector<ll>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int main() {
ll n;
cin>>n;
vi arr(n);
rep(i,0,n){
cin>>arr[i];
}
ll q;
cin>>q;
rep(i,0,q) {
ll x;
cin>>x;
}
vi indices;
rep(i,0,q) {
auto minIt = std::min_element(arr.begin(), arr.end());
int minIndex = std::distance(arr.begin(), minIt);
indices.push_back(minIndex);
*minIt = std::numeric_limits<int>::max();
}
for (int i:indices) {
std::cout << i+1 <<endl;
}
return 0;
}