#include<bits/stdc++.h>
using namespace std;

using i64 = int64_t;

const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);

using Point = complex<double>;
using Polygon = vector<Point>;

inline int sgn(const double &a) { return (a < -EPS ? -1 : (a > EPS ? 1 : 0)); }

inline bool eq(const Point &a, const Point &b) { return abs(a - b) < EPS; }

namespace std {
inline bool operator<(const Point &a, const Point &b) {
    if (sgn(a.imag() - b.imag()))
        return sgn(a.imag() - b.imag()) < 0;
    return sgn(a.real() - b.real()) < 0;
}
} // namespace std

double dot(const Point &a, const Point &b) { return real(conj(a) * b); }

double det(const Point &a, const Point &b) { return imag(conj(a) * b); }

struct Line {
    Point p1, p2;

    Line(Point p1 = Point(), Point p2 = Point()) : p1(p1), p2(p2) {}

    bool operator<(const Line &rhs) const {
        if (eq(p2, rhs.p2))
            return p1 < rhs.p1;
        return p2 < rhs.p2;
    }
    bool operator==(const Line &rhs) const {
        return (eq(p1, rhs.p1) && eq(p2, rhs.p2)) ||
               (eq(p1, rhs.p2) && eq(p2, rhs.p1));
    }
};

inline Point curr(const Polygon &p, const int &i) { return p[i % p.size()]; }

inline Point next(const Polygon &p, const int &i) {
    return p[(i + 1) % p.size()];
}

inline Point prev(const Polygon &p, const int &i) {
    return p[(i + p.size() - 1) % p.size()];
}

enum CCW {
    ONLINE_FRONT = -2,
    CLOCKWISE,
    ON_SEGMENT,
    COUNTER_CLOCKWISE,
    ONLINE_BACK
};

int ccw(Point p0, Point p1, Point p2) {
    Point a = p1 - p0;
    Point b = p2 - p0;
    if (sgn(det(a, b)) == 1)
        return COUNTER_CLOCKWISE;
    if (sgn(det(a, b)) == -1)
        return CLOCKWISE;
    if (sgn(dot(a, b)) == -1)
        return ONLINE_BACK;
    if (sgn(norm(b) - norm(a)) == 1)
        return ONLINE_FRONT;
    return ON_SEGMENT;
}

double dp[42][42][42][42]={0};
int prev_point[42][42][42][42]={0};
bool exists[42]={0};

int main(){
    int n;
    cin >> n;
    vector<pair<Point, int>> v;
    for(int i=0;i<n;++i){
        double x, y;
        cin >> x >> y;
        v.emplace_back(Point(x, y), i+1);
    }
    sort(v.begin(), v.end());
    vector<vector<int>> points_idx;
    for(int i=0;i<n;++i){
        points_idx.push_back(vector<int>());
        for(int j=i+1;j<n;++j){
            points_idx[i].push_back(j);
        }
        Point p = v[i].first;
        auto cmp = [p, v](int a, int b){
            double rad_a = atan2(v[a].first.imag() - p.imag(), v[a].first.real() - p.real());
            double rad_b = atan2(v[b].first.imag() - p.imag(), v[b].first.real() - p.real());
            return sgn(rad_a - rad_b) < 0;
        };
        sort(points_idx[i].begin(), points_idx[i].end(), cmp);
    }

    for(int i=0;i<n;++i){
        for(int j=3;j<=n;++j){
            for(int k=0;k<=n;++k){
                for(int l=0;l<=n;++l){
                    dp[i][j][k][l] = INF;
                }
            }
        }
    }

    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            for(int k=0;k<n;++k){
                if(ccw(v[i].first, v[j].first, v[k].first) != COUNTER_CLOCKWISE)continue;
                prev_point[i][3][j][k] = i;
                dp[i][3][j][k] = abs(det(v[j].first-v[i].first, v[k].first-v[i].first))/2.0;
            }
        }
    }
    exists[3] = true;

    for(int i=0;i<n;++i){
        for(int j=3;j<n;++j){
            for(int k=0;k<(int)points_idx[i].size()-2;++k){
                for(int l=k+1;l<(int)points_idx[i].size()-1;++l){
                    for(int m=l+1;m<(int)points_idx[i].size();++m){
                        Point a = v[points_idx[i][k]].first, b = v[points_idx[i][l]].first, c = v[points_idx[i][m]].first;
                        if(ccw(a, b, c) != COUNTER_CLOCKWISE)continue;
                        int k_idx = points_idx[i][k], l_idx = points_idx[i][l], m_idx = points_idx[i][m];
                        double tri_area = abs(det(c-v[i].first, b-v[i].first))/2.0;
                        double new_area = dp[i][j][k_idx][l_idx] + tri_area;
                        if(sgn(dp[i][j+1][l_idx][m_idx] - new_area) > 0){
                            dp[i][j+1][l_idx][m_idx] = new_area;
                            prev_point[i][j+1][l_idx][m_idx] = k_idx;
                            exists[j+1] = true;
                        }
                    }
                }
            }
        }
    }

    vector<vector<int>> ans(n+1);
    for(int i=3;i<=n;++i){
        double mini = INF;
        int sp = 0, ep1 = 0, ep2 = 0;
        for(int j=0;j<n;++j){
            for(int k=0;k<n;++k){
                for(int l=0;l<n;++l){
                    if(sgn(mini-dp[j][i][k][l]) > 0){
                        mini = dp[j][i][k][l];
                        sp = j;
                        ep1 = k;
                        ep2 = l;
                    }
                }
            }
        }
        vector<int> vp;
        vp.push_back(v[ep2].second); vp.push_back(v[ep1].second);
        int a = ep2, b = ep1, remain = i;
        while(b != sp){
            int c = prev_point[sp][remain][b][a];
            a = b;
            b = c;
            remain--;
            vp.push_back(v[c].second);
        }
        reverse(vp.begin(), vp.end());
        ans[i] = vp;
    }

    int q;
    cin >> q;
    for(int i=0;i<q;++i){
        int k;
        cin >> k;
        if(!exists[k])cout << "NA";
        else {
                for(int j=0;j<(int)ans[k].size();++j){
                if(j!=0)cout << " ";
                cout << ans[k][j];
            }
        }
        cout << endl;
    }

    return 0;
}



Measured memory_bytes: 26540