#include <bits/stdc++.h>

#define ALL(a) (a).begin(), (a).end()
#define llong long long
#define INF (long long)(1LL << 62)
using namespace std;

signed main(){

	llong n, T, Q;
	cin >> n >> T >> Q;

	vector<llong> a(n), d(n), q(Q);
	for(int i = 0; i < n; ++i){
		cin >> a[i] >> d[i];
	}
	for(int i = 0; i < Q; ++i){
		cin >> q[i];
	}

	vector<llong> kabe;
	kabe.push_back(-1 * INF);
	for(int i = 0; i < n - 1; ++i){
		if(d[i] == 1 && d[i+1] == 2){
			kabe.push_back((a[i] + a[i+1]) / 2);
		}
	}
	kabe.push_back(INF);

	/*
	cout << endl;
	for(auto itr = kabe.begin(); itr != kabe.end(); ++itr){
		cout << *itr << endl;
	}	
	cout << endl;
*/
	for(int i = 0; i < Q; ++i){
		int idx = q[i];
		idx--;
		if(d[idx] == 1){
			llong k = *upper_bound(kabe.begin(), kabe.end(), a[idx]);
			//cout << "debug " << k << " " << a[idx] + T << endl; 
			if(a[idx] + T >= k){
				cout << k << endl;
			}else{
				cout << a[idx] + T << endl;
			}
		}else{
			llong k = *prev(lower_bound(kabe.begin(), kabe.end(), a[idx]));
			//cout << "debug2 " << k << endl;
			if(a[idx] - T >= k){
				cout << a[idx] - T << endl;
			}else{
				cout << k << endl;
			}

		}
	}
	return 0;
}


