#include using namespace std; using ll = long long; using pll = pair; #define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i) #define rep(i, n) drep(i, 0, n - 1) #define all(a) (a).begin(), (a).end() #define pb push_back #define fi first #define se second const ll MOD = 1000000007; const ll MOD2 = 998244353; const ll INF = 1LL << 60; const ll MAX_N = 2e5; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll n; cin >> n; priority_queue, vector>, greater>> PQ; rep(i, n){ ll l, r, a; cin >> l >> r >> a; l--; r--; PQ.push({l, 0, a}); PQ.push({r, 2, a}); } ll q; cin >> q; rep(i, q){ ll x; cin >> x; x--; PQ.push({x, 1, i}); } vector ans(q); vector cnt(n, 0); set st; rep(i, n) st.insert(i); while(!PQ.empty()){ ll t = get<1>(PQ.top()); if(t==0){ ll a = get<2>(PQ.top()); if(a(PQ.top()); if((ll)st.size()==0) ans[idx]=n; else ans[idx]=*st.begin(); }else if(t==2){ ll a = get<2>(PQ.top()); if(a