#include <bits/stdc++.h>
#define ll double

using namespace std;

int main()
{
    ll n,m,r;
    cin>>n>>m>>r;
    vector<pair< ll, ll> > a(n);
    vector<ll> q(m);
    for(ll i=0;i<n;i++)cin>>a[i].first>>a[i].second;
    ll mx=0;
    for(ll i=0;i<m;i++){
        cin>>q[i];
        if(r==0){
            cout<<"0 ";
        }
        mx=max(q[i],mx);
    }
    if(r==0)return 0;
    ll x=0;
    vector<ll> res(mx);
    vector<pair< ll, ll> > a1(mx);
    for(ll i=0;i<n;i++){
        a1[i].first=a[i].first;
        a1[a[i].first-1].second=a[i].second;
    }
    cout<<endl;
    for(int i=0;i<mx;i++){
        res[a1[i].first-1]=(1-r)*x+r*a1[i].second;
        x=res[a1[i].first-1];
        for(int j=0;j<m;j++){
            if(i==q[j]-1)
                cout<<x<<" ";
        }
    }
    return 0;
}
