#include <bits/stdc++.h>
using namespace std;
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define x first
#define y second
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a) - 1; i >= (b); i--)
typedef long long ll;
typedef double db;
typedef long double LD;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;h
typedef pair<db, db> pdd;
#ifdef ONPC
mt19937 rnd(228);
#endif
int solve()
{
int n,m,l;
if (!(cin >> n >> m >> l))
return 1;
vector<pair<ll,char>> f;
ll a,b;
FOR(i,0,n)
{
cin >> a >> b;
if(b <= l)
{
f.pb({a-(l-b),'l'});
f.pb({a+(l-b),'r'});
}
}
sort(all(f));
vector<pair<ll,ll>> ar(m);
FOR(i,0,m)
{
cin >> ar[i].x;
ar[i].y = i;
}
sort(all(ar));
vector<ll> res(m,0);
ll fr = 0,fl = 0;
ll cl = 0, cr = 0;
ll s = sz(f);
ll cur = 0;
FOR(i,0,m)
{
//cout << cur << endl;
while(fr < s && f[fr].x <= ar[i].x)
{
if(f[fr].y == 'l')
cur++;
fr++;
}
while(fl < s && f[fl].x < ar[i].x)
{
if(f[fl].y == 'r')
cur--;
fl++;
}
res[ar[i].y] = cur;
}
FOR(i,0,m)
cout << res[i] << endl;
return 0;
}
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int TET = 1e9;
// cin >> TET;
for (int i = 1; i <= TET; i++)
{
if (solve())
break;
#ifdef ONPC
cerr << "_________________________\n";
#endif
}
#ifdef ONPC
cerr << "\nfinished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec\n";
#endif
}