#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <utility>
using namespace std;
#define REP(i, n) for(int i=0; i<(n); i++)
const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
struct L : array<P, 2>{
    L(const P& a, const P& b){ at(0)=a; at(1)=b; }
    L(){}
};

namespace std{
    bool operator < (const P& a, const P& b){
        return (a.Y!=b.Y) ? a.Y<b.Y : a.X<b.X;
    }
    bool operator == (const P& a, const P& b){
        return abs(a-b) < EPS;
    }
}

double dot(P a, P b){
    return (conj(a)*b).X;
}
double cross(P a, P b){
    return (conj(a)*b).Y;
}
int ccw(P a, P b, P c){
    b -= a;
    c -= a;
    if(cross(b,c) > EPS) return +1; //ccw
    if(cross(b,c) < -EPS) return -1; //cw
    if(dot(b,c) < -EPS) return +2; //c-a-b
    if(abs(c)-abs(b) > EPS) return -2; //a-b-c
    return 0; //a-c-b
}

struct info{
    int sp, prev, curr;
    info(int s, int p, int c):sp(s),prev(p),curr(c){}
    info(){}
    bool operator < (const info &a) const{
        return (sp!=a.sp)? sp<a.sp: (prev!=a.prev)? prev<a.prev: curr<a.curr;
    }
};
double dp[40][40][40][41];
pair<int,int> prevtable[40][40][40][41];

int main(){
    int n;
    cin >> n;
    vector<pair<P, int> > ord(n);
    for(int i=0; i<n; i++){
        double x,y;
        cin >> x >> y;
        ord[i] = make_pair(P(x, y), i);
    }
    sort(ord.begin(), ord.end());

    VP p(n);
    vector<int> conv(n);
    for(int i=0; i<n; i++){
        p[i] = ord[i].first;
        conv[i] = ord[i].second +1;
    }

    int q;
    cin >> q;
    vector<int> query(q);
    for(int i=0; i<q; i++){
        cin >> query[i];
    }

    //dp[始点][前の点][今の点][点の数] = 最小面積 
    REP(i,n) REP(j,n) REP(k,n) REP(l,n+1) dp[i][j][k][l] = INF;
    set<info> next;
    for(int fp=0; fp<n; fp++){
        for(int sp=fp+1; sp<n; sp++){
            dp[fp][fp][sp][2] = 0;
            next.insert(info(fp, fp, sp));
        }
    } 

    for(int i=2; i<n; i++){
        set<info> newnext;
        for(info w: next){
            for(int j=w.sp+1; j<n; j++){
                int ret1 = ccw(p[w.prev], p[w.curr], p[j]);
                int ret2 = ccw(p[w.curr], p[j], p[w.sp]);
                if((ret1==1 || ret1==-2) && ret2!=-1){
                    double &update = dp[w.sp][w.curr][j][i+1];
                    double &now = dp[w.sp][w.prev][w.curr][i];
                    double area = cross(p[w.curr]-p[w.sp], p[j]-p[w.sp])/2;
                    if(now +area < update){
                        update = now +area;
                        newnext.insert(info(w.sp, w.curr, j));
                        prevtable[w.sp][w.curr][j][i+1] = make_pair(w.prev, w.curr);
                    }
                }
            }
        }
        next = newnext;
    }

    //経路復元
    for(int i=0; i<q; i++){
        vector<int> ans;
        int sp=-1, curr=-1, prev=-1;
        double minarea = INF;
        for(int s=0; s<n; s++){
            for(int p=0; p<n; p++){
                for(int c=0; c<n; c++){
                    if(dp[s][p][c][query[i]] < minarea){
                        minarea = dp[s][p][c][query[i]];
                        sp = s;
                        prev = p;
                        curr = c;
                    }
                }
            }
        }
        if(sp==-1){
            cout << "NA" << endl;
            continue;
        }
        ans.push_back(conv[curr]);
        ans.push_back(conv[prev]);
        for(int j=query[i]; j>2; j--){
            pair<int,int> pc = prevtable[sp][prev][curr][j];
            prev = pc.first;
            curr = pc.second;
            ans.push_back(conv[prev]);
        }
        for(int j=ans.size()-1; j>0; j--){
            cout << ans[j] << " ";
        }
        cout << ans[0] << endl;
    }
    return 0;
}



Measured memory_bytes: 32248