#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <deque>
#include <algorithm>
#include <queue>
#include <cmath>
#include <map>
#include <complex>
#include <cstring>
#include <cfloat>
#include <iomanip>
#include <stack>
#include <bitset>

using namespace std;
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define repd(i, a, b) for(int i = (a); i > (b); i--)
#define forIt(it, a) for(__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define forRev(it, a) for(__typeof((a).rbegin()) it = (a).rbegin(); it != (a).rend(); it++)
#define ft(a) __typeof((a).begin())
#define ll long long
#define ld long double
#define fi first
#define se second
#define mk make_pair
#define pb push_back
#define sz(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define Rep(i,n) for(int i = 0; i < (n); ++i)
#define bc(n) __builtin_popcountll(n)
#define pii pair<int, int>

typedef complex<ld> cplex;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;
typedef vector<iii> viii;

const int N = 200000 + 7;
const int M = 1007;
const int inf = 1e9 + 7;
const long long linf = 1ll * inf * inf + 7;
const double pi = acos(-1);
const double eps = 1e-6;
const bool multipleTest = false;

int n, k, s, t;
int c[N], v[N];

ll g[N];

bool canGo(ll x) {

    ll curTime = 0;
    ll curGas = x;

    for(int i = 0; i <= k; ++i) {
        {
            if ((g[i + 1] - g[i]) * 2 <= curGas) {
                curTime += g[i + 1] - g[i];
                curGas = x;
            } else {
                if (curGas < g[i + 1] - g[i]) return false;

                curTime += (g[i + 1] - g[i]) * 2 - (g[i + 1] - g[i]) % curGas;
                curGas = x;
            }
        }
    }
//    cout << curTime << "\n";
    return curTime <= t;
}

void solve() {
    cin >> n >> k >> s >> t;

    for(int i = 0; i < n; ++i) scanf("%d%d", c + i, v + i);

    for(int i = 1; i <= k; ++i) {
        scanf("%I64d", g + i);
    }
    g[0] = 0;
    g[k + 1] = s;
    sort(g, g + k + 2);

//    cout << canGo(6) << "\n";
//    return;

//    for(int i = 0; i <= k + 1; ++i)
//        cout << g[i] << "\n";

//    for(int i = 0; i <= 20; ++i) {
//        cout << i << " " << canGo(i) << "\n";
//    }

    ll mnLimit = inf;
    ll lo = 0, hi = inf;
    while (lo <= hi) {
        ll g = (0ll + lo + hi) >> 1;
//        cout << g << " " << canGo(g) << "\n";
        if (canGo(g)) {
            mnLimit = g;
            hi = g - 1;
        } else lo = g + 1;
    }

//    cout << mnLimit << "\n";

    int ans = inf;

    for(int i = 0; i < n; ++i)
        if (v[i] >= mnLimit) {
            ans = min(ans, c[i]);
        }

    if (ans == inf) ans = -1;
    cout << ans << "\n";
}

void createTest() {
    freopen("in.txt", "w", stdout);
    cout << 100000 << "\n";
    for(int i = 1; i <= 100000; ++i) {
        cout << rand() % inf << " ";
    }

}

int main() {
#ifdef _LOCAL_
    freopen("in.txt", "r", stdin);
    clock_t t1 = clock();
#endif
    //            createTest();
    //            return 0;
    //    freopen("out.txt", "w", stdout);

    if (fopen("f.in", "r")) {
        freopen("f.in", "r", stdin);
        freopen("f.out", "w", stdout);
    }

    int Test = 1;
    if (multipleTest) {
        cin >> Test;
    }

    for(int i = 0; i < Test; ++i) {
        //        printf("Case #%d: ", i + 1);
        solve();
    }

#ifdef _LOCAL_
    cout<<"\n" << 1.0 * (clock() - t1) / CLOCKS_PER_SEC<<endl;
#endif

}


#include<bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define ss(x) scanf("%s",x)
#define ll long long
#define mod 1000000007
#define bitcount    __builtin_popcountll
#define pb push_back
struct car
{
    ll cost,cap;
} cars[200005];
ll stations[200005];
bool comp(car a,car b)
{
    if(a.cap<=b.cap)
        return true;
    return a.cost<=b.cost;
}
ll calc(ll val,ll k)
{
    ll ans=0,diff;
    for(ll i=1;i<k;i++)
    {
        diff=stations[i]-stations[i-1];
        if(val<diff)
            return -1;
        if(val>=2*diff)
            ans+=diff;
        else
        {
            ans+=(val-diff)+(2*(2*diff-val));
        }
    }
    return ans;
}
ll binarysearch(ll val,ll low,ll high)
{
    ll mid=(low+high)/2;
    if(cars[mid-1].cap<val)
        return binarysearch(val,mid+1,high);
    if(mid==1)
        return 1;
    if(cars[mid-2].cap<val)
        return mid;
    return binarysearch(val,low,mid-1);
}
int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    ll n,k,s,t,x,y,i,ans,low,high,time,pos;
    cin>>n>>k>>s>>t;
    for(i=0;i<n;i++)
    {
        sd(cars[i].cost);
        sd(cars[i].cap);
    }
    stations[0]=0;
    stations[k+1]=s;
    for(i=1;i<=k;i++)
        sd(stations[i]);
    sort(stations,stations+k+2);
    sort(cars,cars+n,comp);
    low=1;
    high=1e9;
    while(low<=high)
    {
        ans=(low+high)/2;
        time=calc(ans,k+2);
        if(time==-1||time>t)
        {
            low=ans+1;
            continue;
        }
        if(time<=t&&ans==1)
        {
            break;
        }
        time=calc(ans-1,k+2);
        if(time>t||time==-1)
            break;
        high=ans-1;
    }
    //cout<<ans<<" "<<low<<" "<<high<<endl;
    if(low>high)
        cout<<-1<<endl;
    else
    {
        pos=binarysearch(ans,1,n);
        if(pos<1||pos>n)
            cout<<-1<<endl;
        else
        {
            ll mini=mod;
            for(i=pos-1;i<n;i++)
            {
                if(cars[i].cost<mini)
                    mini=cars[i].cost;
            }
            cout<<mini<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define ss(x) scanf("%s",x)
#define ll long long
#define mod 1000000007
#define bitcount    __builtin_popcountll
#define pb push_back
struct car
{
    ll cost,cap;
} cars[200005];
ll stations[200005];
ll calc(ll val,ll k)
{
    ll ans=0,diff;
    for(ll i=1;i<k;i++)
    {
        diff=stations[i]-stations[i-1];
        if(val<diff)
            return -1;
        if(val>=2*diff)
            ans+=diff;
        else
        {
            ans+=(val-diff)+(2*(2*diff-val));
        }
    }
    return ans;
}
int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    ll n,k,s,t,x,y,i,ans,low,high,time,pos;
    cin>>n>>k>>s>>t;
    for(i=0;i<n;i++)
    {
        sd(cars[i].cost);
        sd(cars[i].cap);
    }
    stations[0]=0;
    stations[k+1]=s;
    for(i=1;i<=k;i++)
        sd(stations[i]);
    sort(stations,stations+k+2);
    low=1;
    high=1e9;
    while(low<=high)
    {
        ans=(low+high)/2;
        time=calc(ans,k+2);
        if(time==-1||time>t)
        {
            low=ans+1;
            continue;
        }
        if(time<=t&&ans==1)
        {
            break;
        }
        time=calc(ans-1,k+2);
        if(time>t||time==-1)
            break;
        high=ans-1;
    }
    //cout<<ans<<" "<<low<<" "<<high<<endl;
    if(low>high)
        cout<<-1<<endl;
    else
    {
        ll mini=mod;
        for(i=0;i<n;i++)
        {
            if(cars[i].cap>=ans)
            {
                if(cars[i].cost<=mini)
                    mini=cars[i].cost;
            }
        }
        if(mini==mod)
            cout<<-1<<endl;
        else
            cout<<mini<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define ss(x) scanf("%s",x)
#define ll long long
#define mod 1000000007
#define bitcount    __builtin_popcountll
#define pb push_back
struct car
{
    ll cost,cap;
} cars[200005];
ll stations[200005];
bool comp(car a,car b)
{
    if(a.cap<=b.cap)
        return true;
    return a.cost<=b.cost;
}
ll calc(ll val,ll k)
{
    ll ans=0,diff;
    for(ll i=1;i<k;i++)
    {
        diff=stations[i]-stations[i-1];
        if(val<diff)
            return -1;
        if(val>=2*diff)
            ans+=diff;
        else
        {
            ans+=(val-diff)+(2*(2*diff-val));
        }
    }
    return ans;
}
ll binarysearch(ll val,ll low,ll high)
{
    if(low>high)
        return -1;
    ll mid=(low+high)/2;
    if(cars[mid-1].cap<val)
        return binarysearch(val,mid+1,high);
    if(mid==1)
        return 1;
    if(cars[mid-2].cap<val)
        return mid;
    return binarysearch(val,low,mid-1);
}
int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    ll n,k,s,t,x,y,i,ans,low,high,time,pos;
    cin>>n>>k>>s>>t;
    for(i=0;i<n;i++)
    {
        sd(cars[i].cost);
        sd(cars[i].cap);
    }
    stations[0]=0;
    stations[k+1]=s;
    for(i=1;i<=k;i++)
        sd(stations[i]);
    sort(stations,stations+k+2);
    sort(cars,cars+n,comp);
    low=1;
    high=1e9;
    while(low<=high)
    {
        ans=(low+high)/2;
        time=calc(ans,k+2);
        if(time==-1||time>t)
        {
            low=ans+1;
            continue;
        }
        if(time<=t&&ans==1)
        {
            break;
        }
        time=calc(ans-1,k+2);
        if(time>t||time==-1)
            break;
        high=ans-1;
    }
    //cout<<ans<<" "<<low<<" "<<high<<endl;
    if(low>high)
        cout<<-1<<endl;
    else
    {
        pos=binarysearch(ans,1,n);
        if(pos<1||pos>n)
            cout<<-1<<endl;
        else
        {
            ll mini=mod;
            for(i=pos-1;i<n;i++)
            {
                if(cars[i].cost<mini)
                    mini=cars[i].cost;
            }
            cout<<mini<<endl;
        }
    }
    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<list>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cmath>
#include<cctype>

#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<vector<ll> > mat;

ll c[200005],v[200005],a[200005];

int main()
{ios_base::sync_with_stdio(false);
ll n,s,k,t;
cin>>n>>k>>s>>t;
rep(i,0,n-1)cin>>c[i]>>v[i];
rep(i,1,k)cin>>a[i];
sort(a+1,a+k+1);
a[k+1]=s;a[0]=0;

ll lo=0,hi=1e18+7,mid,mxx=1e10;
while(lo<hi)
{
	mid=(lo+hi)/2;
	ll tt=0;
	rep(i,1,k+1)
	{
		ll dis=a[i]-a[i-1];
		ll diff=(mid-dis);
		if(diff<0)
		tt+=mxx;
		else
		{
			ll d2=min(diff,dis);
			tt+=d2+(dis-d2)*2;
		}
	}
	if(tt<=t)
	{
		hi=mid;
	}
	else
	lo=mid+1;
}

ll ans=1e18+7;

rep(i,0,n-1)
{
	if(v[i]>=lo)
	ans=min(ans,c[i]);
}

if(ans>1e15)
ol("-1");
else
ol(ans);

return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <deque>
#include <cstring>
#include <string>
#include <cstdlib>
using namespace std;
#define fi "input.txt"
#define fo "output.txt"
#define fileopen freopen(fi,"r",stdin);freopen(fo,"w",stdout);
#define FOR(i,l,r) for(int i=(int)l;i<=(int)r;i++)
#define FORD(i,l,r) for(int i=(int)l;i>=(int)r;i--)
#define xy pair<int,int>
#define pb push_back
#define int64 long long
#define X first
#define Y second
#define init(a,v) memset(a,v,sizeof(a))
#define Sz(s) ((int)s.size())
#define forever while (true)
#define ran(l,r) (rand()%((int)(r)-(int)(l)+1)+(int)(l))
#define EL printf("\n")

const int OO = 2e9;
const int MOD = 1e9+7;
const double Pi = 3.141592653589793;
const int N = 3e5+5;

int c[N],v[N],g[N],a[N],n,k,s,t,m=0,mx=0,mn=-1,res=OO;

int check(int cap) {
    cap=min(cap,2*s);
    int64 time=0;
    FOR(i,1,m) {
        int y=max(0,min(a[i],cap-a[i])),x=a[i]-y;
        time+=2LL*x+y;
    }
    return (time<=t);
}

int main() {
    cin>>n>>k>>s>>t;
    if (s>t) {
        cout<<-1;
        return 0;
    }
    FOR(i,1,n) scanf("%i%i",&v[i],&c[i]);
    FOR(i,1,k) scanf("%i",&g[i]);
    g[++k]=s;
    g[++k]=0;
    sort(g+1,g+k+1);
    FOR(i,2,k) a[++m]=g[i]-g[i-1],mx=max(mx,a[m]);
    int l=mx,r=s*2,mid;
    while (l<=r) {
        mid=(l+r)>>1;
        if (check(mid))
            mn=mid,r=mid-1;
        else l=mid+1;
    }
    FOR(i,1,n) if (c[i]>=mn) res=min(res,v[i]);
    if (res==OO) cout<<-1; else cout<<res;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <deque>
#include <cstring>
#include <string>
#include <cstdlib>
using namespace std;
#define fi "input.txt"
#define fo "output.txt"
#define fileopen freopen(fi,"r",stdin);freopen(fo,"w",stdout);
#define FOR(i,l,r) for(int i=(int)l;i<=(int)r;i++)
#define FORD(i,l,r) for(int i=(int)l;i>=(int)r;i--)
#define xy pair<int,int>
#define pb push_back
#define int64 long long
#define X first
#define Y second
#define init(a,v) memset(a,v,sizeof(a))
#define Sz(s) ((int)s.size())
#define forever while (true)
#define ran(l,r) (rand()%((int)(r)-(int)(l)+1)+(int)(l))
#define EL printf("\n")

const int OO = 2e9;
const int MOD = 1e9+7;
const double Pi = 3.141592653589793;
const int N = 3e5+5;

int64 c[N],v[N],g[N],a[N],n,k,s,t,m=0,mx=0,mn=-1,res=OO;

bool check(int64 cap) {
    int64 time=0;
    FOR(i,1,m) {
        if (a[i]>cap) return false;
        int64 y=max(0LL,min(a[i],cap-a[i])),x=a[i]-y;
        time+=2LL*x+y;
    }
    return (time<=t);
}

int main() {
    cin>>n>>k>>s>>t;
    if (s>t) {
        cout<<-1;
        return 0;
    }
    FOR(i,1,n) scanf("%i%i",&v[i],&c[i]);
    FOR(i,1,k) scanf("%i",&g[i]);
    g[++k]=s;
    g[++k]=0;
    sort(g+1,g+k+1);
    FOR(i,2,k) a[++m]=g[i]-g[i-1],mx=max(mx,a[m]);
    int64 l=mx,r=s*2,mid;
    while (l<=r) {
        mid=(l+r)>>1;
        if (check(mid))
            mn=mid,r=mid-1;
        else l=mid+1;
    }
    FOR(i,1,n) if (c[i]>=mn) res=min(res,v[i]);
    if (res==OO) cout<<-1; else cout<<res;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <deque>
#include <cstring>
#include <string>
#include <cstdlib>
using namespace std;
#define fi "input.txt"
#define fo "output.txt"
#define fileopen freopen(fi,"r",stdin);freopen(fo,"w",stdout);
#define FOR(i,l,r) for(int i=(int)l;i<=(int)r;i++)
#define FORD(i,l,r) for(int i=(int)l;i>=(int)r;i--)
#define xy pair<int,int>
#define pb push_back
#define int64 long long
#define X first
#define Y second
#define init(a,v) memset(a,v,sizeof(a))
#define Sz(s) ((int)s.size())
#define forever while (true)
#define ran(l,r) (rand()%((int)(r)-(int)(l)+1)+(int)(l))
#define EL printf("\n")

const int OO = 2e9;
const int MOD = 1e9+7;
const double Pi = 3.141592653589793;
const int N = 3e5+5;

int64 c[N],v[N],g[N],a[N],n,k,s,t,m=0,mx=0,mn=-1,res=OO;

bool check(int cap) {
    int64 time=0;
    FOR(i,1,m) {
        if (a[i]>cap) return false;
        int64 y=max(0,min(a[i],cap-a[i])),x=a[i]-y;
        time+=2LL*x+y;
    }
    return (time<=t);
}

int main() {
    cin>>n>>k>>s>>t;
    if (s>t) {
        cout<<-1;
        return 0;
    }
    FOR(i,1,n) scanf("%i%i",&v[i],&c[i]);
    FOR(i,1,k) scanf("%i",&g[i]);
    g[++k]=s;
    g[++k]=0;
    sort(g+1,g+k+1);
    FOR(i,2,k) a[++m]=g[i]-g[i-1],mx=max(mx,a[m]);
    int64 l=mx,r=s*2,mid;
    while (l<=r) {
        mid=(l+r)>>1;
        if (check(mid))
            mn=mid,r=mid-1;
        else l=mid+1;
    }
    FOR(i,1,n) if (c[i]>=mn) res=min(res,v[i]);
    if (res==OO) cout<<-1; else cout<<res;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

const int maxn = 200010;

const int INF = 1e9;

int c[maxn];
int v[maxn];

int g[maxn];

int n,k,s,t;	//���� ����վ�� ·�� ʱ��

bool judge(int x){
	int Time = 0;
	for(int i=0;i<=k;i++){
		int distance = g[i+1] - g[i];
		if(distance > x){
			return 0;
		}

		int tmp = x - distance;
		tmp = min(distance,tmp);

		Time += tmp + (distance-tmp)*2;

	}

	if(Time > t){
		return 0;
	}else{
		return 1;
	}

}

int bs(){
	int l = 1;
	int r = maxn * 2;

	int res = -1;
	while(l<=r){

		int mid = (l+r)>>1;
		if(judge(mid)){
			res = mid;
			r = mid - 1;
		}else{
			l = mid + 1;
		}
	}
	return res;
}

int main(){

	cin>>n>>k>>s>>t;

	for(int i=1;i<=n;i++){
		scanf("%d %d",&c[i],&v[i]);
	}

	for(int i=1;i<=k;i++){
		scanf("%d",&g[i]);
	}

	sort(g+1,g+k+1);
	g[0] = 0;
	g[k+1] = s;

	int MIN = bs();

//	cout<<MIN<<endl;

	int res = INF;
	for(int i=1;i<=n;i++){
		if(v[i]>=MIN){
			res = min(res,c[i]);
		}
	}

	if(res == INF){
		cout<<-1<<endl;
	}else{
		cout<<res<<endl;
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

const int maxn = 200010;

const ll INF = 1e18;

ll c[maxn];
ll v[maxn];

ll g[maxn];

ll n,k,s,t;	//���� ����վ�� ·�� ʱ��

bool judge(ll x){
	ll Time = 0;
	for(int i=0;i<=k;i++){
		ll distance = g[i+1] - g[i];
		if(distance > x){
			return 0;
		}

		ll tmp = x - distance;
		tmp = min(distance,tmp);

		Time += tmp + (distance-tmp)*2;

		if(Time > t){
			return 0;
		}

	}

	if(Time > t){
		return 0;
	}else{
		return 1;
	}

}

ll bs(){
	ll l = 1;
	ll r = 4e9+10;

	ll res = -1;
	while(l<=r){

		ll mid = (l+r)>>1;
		if(judge(mid)){
			res = mid;
			r = mid - 1;
		}else{
			l = mid + 1;
		}
	}
	return res;
}

int main(){

	cin>>n>>k>>s>>t;

	for(int i=1;i<=n;i++){
		scanf("%I64d %I64d",&c[i],&v[i]);
	}

	for(int i=1;i<=k;i++){
		scanf("%I64d",&g[i]);
	}

	sort(g+1,g+k+1);
	g[0] = 0;
	g[k+1] = s;

	ll MIN = bs();

//	cout<<MIN<<endl;

	ll res = INF;
	for(int i=1;i<=n;i++){
		if(v[i]>=MIN){
			res = min(res,c[i]);
		}
	}

	if(res == INF || MIN == -1){
		cout<<-1<<endl;
	}else{
		cout<<res<<endl;
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

char s[200010];

int main(){

	int n,a,b,k;
	cin>>n>>a>>b>>k;  //���� ���� ������

	scanf("%s",s+1);

	int cnt = 0;
	int leftMost = -1;
	int ship = 0;
	for(int i=n;i>=1;i--){
		if(s[i] == '0'){
			cnt++;
		}else{
			cnt = 0;
		}
		if(cnt == b){
			cnt = 0;
			ship++;
		}
		if(ship == a){
			leftMost = i;
			break;
		}
	}

	vector<int> hit;

	cnt = 0;
	int ans = 0;
	bool flag = 0;
	for(int i=1;i<=n;i++){
		if(s[i] == '0'){
			cnt++;
		}else{
			cnt = 0;
		}
		if(cnt == b){
			if(i<leftMost){

				ans++;
				hit.push_back(i);
				if(flag){
					break;
				}
				//i += b-1;

				int Time = b-1;
				while(Time-- && i<=n && s[i]=='0'){
					i++;
				}

				cnt = 0;
				flag = 1;
			}else{
				ans++;
				hit.push_back(i);
				break;
			}
		}
	}

	cout<<ans<<endl;

	for(int i=0;i<hit.size();i++){
		printf("%d ",hit[i]);
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

const int maxn = 200010;

const ll INF = 1e18;

ll c[maxn];
ll v[maxn];

ll g[maxn];

ll n,k,s,t;	//���� ����վ�� ·�� ʱ��

bool judge(ll x){
	ll Time = 0;
	for(int i=0;i<=k;i++){
		ll distance = g[i+1] - g[i];
		if(distance > x){
			return 0;
		}

		ll tmp = x - distance;
		tmp = min(distance,tmp);

		Time += tmp + (distance-tmp)*2;

		if(Time > t){
			return 0;
		}

	}

	if(Time > t){
		return 0;
	}else{
		return 1;
	}

}

ll bs(){
	ll l = 1;
	ll r = 4e9+10;

	ll res = -1;
	while(l<=r){

		ll mid = (l+r)>>1;
		if(judge(mid)){
			res = mid;
			r = mid - 1;
		}else{
			l = mid + 1;
		}
	}
	return res;
}

int main(){

	cin>>n>>k>>s>>t;

	for(int i=1;i<=n;i++){
		scanf("%I64d %I64d",&c[i],&v[i]);
	}

	for(int i=1;i<=k;i++){
		scanf("%I64d",&g[i]);
	}

	sort(g+1,g+k+1);
	g[0] = 0;
	g[k+1] = s;

	ll MIN = bs();

//	cout<<MIN<<endl;

	ll res = INF;
	for(int i=1;i<=n;i++){
		if(v[i]>=MIN){
			res = min(res,c[i]);
		}
	}

	if(res == INF){
		cout<<-1<<endl;
	}else{
		cout<<res<<endl;
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

const int maxn = 200010;

const int INF = 1e9;

int c[maxn];
int v[maxn];

int g[maxn];

int n,k,s,t;	//���� ����վ�� ·�� ʱ��

bool judge(int x){
	ll Time = 0;
	for(int i=0;i<=k;i++){
		ll distance = g[i+1] - g[i];
		if(distance > x){
			return 0;
		}

		ll tmp = x - distance;
		tmp = min(distance,tmp);

		Time += tmp + (distance-tmp)*2;

		if(Time > t){
			return 0;
		}

	}

	if(Time > t){
		return 0;
	}else{
		return 1;
	}

}

int bs(){
	int l = 1;
	int r = maxn * 2;

	int res = -1;
	while(l<=r){

		int mid = (l+r)>>1;
		if(judge(mid)){
			res = mid;
			r = mid - 1;
		}else{
			l = mid + 1;
		}
	}
	return res;
}

int main(){

	cin>>n>>k>>s>>t;

	for(int i=1;i<=n;i++){
		scanf("%d %d",&c[i],&v[i]);
	}

	for(int i=1;i<=k;i++){
		scanf("%d",&g[i]);
	}

	sort(g+1,g+k+1);
	g[0] = 0;
	g[k+1] = s;

	int MIN = bs();

//	cout<<MIN<<endl;

	int res = INF;
	for(int i=1;i<=n;i++){
		if(v[i]>=MIN){
			res = min(res,c[i]);
		}
	}

	if(res == INF){
		cout<<-1<<endl;
	}else{
		cout<<res<<endl;
	}

	return 0;
}


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

typedef long long LL;
typedef vector<LL> VI;
#define FOR(x, a, b) for (LL x = (a); x <= (b); x++)
#define FORD(x, a, b) for (LL x = (a); x >= (b); x--)
#define REP(x, n) for (LL x = 0; x < (n); x++)
#define VAR(v, n) __typeof(n) v = (n)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(x) (LL((x).size()))
#define FOREACH(i, c) for (VAR(i, (c).begin()); i != (c).end(); i++)
#define PB push_back
#define ST first
#define ND second
#define POKAZ(x) cerr << #x << " = " << (x) << '\n'

const LL MAX = 200100;
LL n, k, s, t, c[MAX], v[MAX], g[MAX + 2], roz[MAX + 1];

void wczytaj_dane()
{
	cin >> n >> k >> s >> t;
	REP(i, n)
		cin >> c[i] >> v[i];
	g[0] = 0;
	FOR(i, 1, k)
		cin >> g[i];
	sort(g + 1, g + k + 1);
	g[k + 1] = s;
}

void wypelnij_roz()
{
	REP(i, k + 1)
		roz[i] = g[i + 1] - g[i];
}

bool da_sie(LL p)
{
	LL czas = 0;
	REP(i, k + 1)
		czas += max(roz[i], 3 * roz[i] - p);
	return czas <= t;
}

LL optymalna_pojemnosc()
{
	LL pocz = *max_element(roz, roz + k + 1), kon = 2 * s;
	while (pocz < kon)
	{
		LL srod = (pocz + kon) / 2;
		if (da_sie(srod))
			kon = srod;
		else
			pocz = srod + 1;
	}
	return pocz;
}

LL koszt_samochodu(LL p)
{
	LL w = -1;
	REP(i, n)
		if (v[i] >= p)
			w = (w == -1 || c[i] < c[w] ? i : w);
	return w != -1 ? c[w] : -1;
}

LL rozwiaz()
{
	if (t < s)
		return -1;
	LL p = optymalna_pojemnosc();
	return koszt_samochodu(p);
}

void zrob_test()
{
	wczytaj_dane();
	wypelnij_roz();
	cout << rozwiaz() << '\n';
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	zrob_test();
	return 0;
}


#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Ford(i,a,b) for(int i=a;i>=b;i--)
#define dream_hyojooslh

using namespace std;
const int N=200000+1067;
int a[N],b[N],c[N],n,k,s,t;
bool check(int x) {
    long long res=0;
    For(i,1,k) {
        int t=c[i]-c[i-1];
        if (t>x) return false;
        res+=t*2;
        int x1=x-t;
        res-=min(x1,t);
    }
    if (res>t ) return false; else return true;
}

int  bs(int l,int r) {
    while (l<r) {
        if (l==r-1) {
            if (check(l)) return l; else return r;
        }
        int mid=(l+r)/2;
        if (check(mid)) r=mid; else l=mid+1;
    }
    return r;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("dream_hyojooslh.inp","r",stdin);
    cin>>n>>k>>s>>t;
    For(i,1,n) {
        cin>>a[i]>>b[i];
    }

    For(i,1,k) cin>>c[i];
    ++k;
    c[k]=s;
    sort(c+1,c+k+1);
    int nnn=bs(1,1000000000);
    if (!check(nnn)) {
        cout<<-1<<endl;
        return 0;
    }
    int res=1000000001;
    For(i,1,n) if (b[i]>=nnn) {
        res=min(res,a[i]);
    }
    if (res==1000000001) cout<<-1<<endl; else
    cout<<res<<endl;
    return 0;
}


#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <set>
#include <stack>
#include <map>
#include <cmath>
#include <vector>
#include <queue>
#include <functional>
#include <time.h>

using namespace std;
#define MP make_pair
#define lli unsigned long long int
#define y1 y123123
const int N = 2e6 + 200;
const long long int M = 1000000007;
const lli INF = M * M;
const int L = 20;

int n, k, s, t;
int g[N];

bool check(int cp) {
    int pos = 0, time = 0;
    for (int i = 1; i < k; ++i) {
        int dist = g[i] - g[i-1];
        if (dist > cp) return false;
        int sp = min(cp - dist, dist);
        int mt =  sp + 2 * (dist - sp);
        time += mt;
    }
    return time <= t;
}

int main() {
    ios_base::sync_with_stdio(0);
#ifdef FILE_IO
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
    cin >> n >> k >> s >> t;
    vector<pair<int, int> > cars(n);
    for (int i = 0; i < n; ++i) {
        cin >> cars[i].first >> cars[i].second;
    }
    for (int i = 0; i < k; ++i) cin >> g[i + 1];
    sort(g + 1, g + k + 1);
    g[k + 1] = s;
    k += 2;
    int l = 0, r = 1e9 + 10;
    while (r - l > 1) {
        int m = (l + r) / 2;
        if (check(m)) r = m;
        else l = m;
    }
    int minP = check(l) ? l : r;
    //cout << minP << endl;
    int ans = -1;
    for (int i = 0; i < n; ++i) {
        if (cars[i].second >= minP && (ans == -1 || ans > cars[i].first))
            ans = cars[i].first;
    }
    cout << ans;
}


#include <cstdio>
#include <algorithm>
using namespace std;
#define N 200000 + 5
#define mp make_pair

int n, k, s, t, Pos[N], Min[N];

struct Car
{
	int c, v;
	Car (int _c = 0, int _v = 0) {c = _c, v = _v;}
	bool operator < (const Car a) const
	{
		return mp(v, c) < mp(a.v, a.c);
	}
}E[N];

inline bool Check(int v)
{
	int ret = t;
	for (int i = 1; i <= k; i ++)
	{
		int x = 2 * (Pos[i] - Pos[i - 1]) - v;
		int y = v - (Pos[i] - Pos[i - 1]);
		if (y < 0) return 0;
		if (x < 0) x = 0, y = Pos[i] - Pos[i - 1];
		int tmp = 2 * x + y;
		ret -= tmp;
		if (ret < 0) return 0;
	}
	return 1;
}

int main()
{
	scanf("%d%d%d%d", &n, &k, &s, &t);
	for (int i = 1, c, v; i <= n; i ++)
	{
		scanf("%d%d", &c, &v);
		E[i] = Car(c, v);
	}
	sort(E + 1, E + n + 1);
	for (int i = n; i; i --)
		Min[i] = i == n ? E[i].c : min(Min[i + 1], E[i].c);
	for (int i = 1; i <= k; i ++)
		scanf("%d", Pos + i);
	sort(Pos + 1, Pos + k + 1);
	Pos[++ k] = s;
	int l = 1, r = n + 1;
	while (l < r)
	{
		int mid = l + r >> 1;
		if (Check(E[mid].v)) r = mid;
		else l = mid + 1;
	}
	if (l > n) puts("-1");
	else printf("%d\n", Min[l]);
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef double DB;
typedef long long LL;
typedef unsigned long long int ULL;
const int INF = 0x3f3f3f3f;
const LL LINF = 2e18;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repu(i, a, b) for(int i = (a); i < (b); i++)
#define repf(i, a, b) for(int i = (a); i <= (b); i++)
#define repd(i, a, b) for(int i = (a); i >= (b); i--)
#define MEM(x,i) memset((x),(i),sizeof(x))
const double PI = acos(-1.0);
const double E = exp(1);
const double EPS = 1e-8;
const long long  mod = 1e4+7;
const int maxn=2e5+5;
void pre(){
     freopen("in.txt", "r", stdin);
     freopen("out.txt", "w", stdout);
}

int ca[maxn]={0},va[maxn]={0},ka[maxn]={0};
	int n,k,s,t;
bool solve(int base){
	int cs=-1;
	rep(i,n){
		if(ca[i]<=base){
			cs=max(cs,va[i]);
		}
	}
	int time=0;
	repu(i,1,k+2){
		int len=ka[i]-ka[i-1];
		if(cs<len){
			return false;
		}else{
			if(cs/2>=len){
				time+=len;
			}else{
				time+=((cs-len)+(2*len-cs)*2);
			}
		}
	}
	return time<=t;
}
int main(void){

	cin>>n>>k>>s>>t;
	rep(i,n){
		scanf("%d%d",&ca[i],&va[i]);
	}
	ka[0]=0;
	ka[k+1]=s;
	repf(i,1,k){
		scanf("%d",&ka[i]);
	}
	sort(ka,ka+k+2);
	int pl=0,pr=1e9;
	while(pl<pr){
		int mid=pr+pl>>1;
		if(solve(mid)){
			pr=mid;
		}
		else{
			pl=mid+1;
		}
	}
	if(solve(pr)){
		cout<<pr<<endl;
	}else
		puts("-1");
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef double DB;
typedef long long LL;
typedef unsigned long long int ULL;
const int INF = 0x3f3f3f3f;
const LL LINF = 2e18;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repu(i, a, b) for(int i = (a); i < (b); i++)
#define repf(i, a, b) for(int i = (a); i <= (b); i++)
#define repd(i, a, b) for(int i = (a); i >= (b); i--)
#define MEM(x,i) memset((x),(i),sizeof(x))
const double PI = acos(-1.0);
const double E = exp(1);
const double EPS = 1e-8;
const long long  mod = 1e4+7;
const int maxn=2e5+5;
void pre(){
     freopen("in.txt", "r", stdin);
     freopen("out.txt", "w", stdout);
}

int ca[maxn]={0},va[maxn]={0},ka[maxn]={0};
	int n,k,s,t;
bool solve(int base){
	int cs=-1;
	rep(i,n){
		if(ca[i]<=base){
			cs=max(cs,va[i]);
		}
	}
	int time=0;
	repu(i,1,k+2){
		int len=ka[i]-ka[i-1];
		if(cs<len){
			return false;
		}else{
			if(cs/2>=len){
				time+=len;
			}else{
				time+=((cs-len)+(2*len-cs)*2);
			}
		}
	}
	return time<=t;
}
int main(void){

	cin>>n>>k>>s>>t;
	rep(i,n){
		cin>>ca[i]>>va[i];
	}
	ka[0]=0;
	ka[k+1]=s;
	repf(i,1,k){
		cin>>ka[i];
	}
	sort(ka,ka+k+2);
	int pl=0,pr=1e9;
	while(pl<pr){
		int mid=pr+pl>>1;
		if(solve(mid)){
			pr=mid;
		}
		else{
			pl=mid+1;
		}
	}
	if(solve(pr)){
		cout<<pr<<endl;
	}else
		puts("-1");
	return 0;
}


#include <time.h>
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include<algorithm>
#define MAXN 200000
#define eps 1e-6

using namespace std;
int c[MAXN+70],v[MAXN+70],g[MAXN+80],k;
bool chk(int tank,int time)
{
	int i;
	for(i=0;i<k;i++)
	{
		if(g[i+1]-g[i]>tank)
			return 0;
		if((g[i+1]-g[i])*2>=tank)
			time-=(3*(g[i+1]-g[i])-tank);
		else
			time-=(g[i+1]-g[i]);
		if(time<-eps)
			return 0;
	}
	return 1;
}
int main()
{
	int n,s,t,i,Min=-1,l=1<<30,mid,r=0;
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(i=1;i<=n;i++)
	{
		scanf("%d%d",c+i,v+i);
		l=min(l,v[i]);
		r=max(r,v[i]);
	}
	for(i=1;i<=k;i++)
		scanf("%d",g+i);
	g[++k]=s;
	sort(g+1,g+k+1);
	while(l<=r)
	{
		mid=(l+r+1)>>1;
		if(chk(mid,t))
			r=mid;
		else
			l=mid+1;
	}
	for(i=1;i<=n;i++)
		if(v[i]>=l&&(Min==-1||Min>c[i]))
			Min=c[i];
	printf("%d",Min);
	return 0;
}


#include <time.h>
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include<algorithm>
#define MAXN 200000
#define eps 1e-6

using namespace std;
int c[MAXN+70],v[MAXN+70],g[MAXN+80],k;
bool chk(int tank,int time)
{
	int i;
	for(i=0;i<k;i++)
	{
		if(g[i+1]-g[i]>tank)
			return 0;
		if((g[i+1]-g[i])*2>=tank)
			time-=(3*(g[i+1]-g[i])-tank);
		else
			time-=(g[i+1]-g[i]);
		if(time<-eps)
			return 0;
	}
	return 1;
}
int main()
{
	int n,s,t,i,Min=-1,l=1<<30,mid,r=0;
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(i=1;i<=n;i++)
	{
		scanf("%d%d",c+i,v+i);
		l=min(l,v[i]);
		r=max(r,v[i]);
	}
	for(i=1;i<=k;i++)
		scanf("%d",g+i);
	g[++k]=s;
	sort(g+1,g+k+1);
	while(l<=r)
	{
		mid=(l+r)>>1;
		if(chk(mid,t))
			r=mid;
		else
			l=mid+1;
	}
	for(i=1;i<=n;i++)
		if(v[i]>=l&&(Min==-1||Min>c[i]))
			Min=c[i];
	printf("%d",Min);
	return 0;
}


#include <time.h>
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include<algorithm>
#define MAXN 200000
#define eps 1e-6

using namespace std;
int g[MAXN+80],k;
struct node
{
	int c,v;
	bool operator <(const node &x)const
	{
		return c<x.c;
	}
}array[MAXN+70];
bool chk(int tank,double time)
{
	int i;
	for(i=0;i<k;i++)
	{
		if(g[i+1]-g[i]>tank)
			return 0;
		if((g[i+1]-g[i])*2>=tank)
			time-=(3*(g[i+1]-g[i])-tank);
		else
			time-=(g[i+1]-g[i]);
		if(time<-eps)
			return 0;
	}
	return 1;
}
int main()
{
	int n,s,t,i,gap;
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(i=1;i<=n;i++)
		scanf("%d%d",&array[i].c,&array[i].v);
	for(i=1;i<=k;i++)
		scanf("%d",g+i);
	g[++k]=s;
	sort(g+1,g+k+1);
	sort(array+1,array+n+1);
	for(gap=g[1]-g[0],i=1;i<k;i++)
		gap=max(gap,g[i+1]-g[i]);
	for(i=1;i<=n;i++)
		if(array[i].v>=gap&&chk(array[i].v,t))
			break;
	printf("%d",i<=n?array[i].c:-1);
	return 0;
}


#include <time.h>
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include<algorithm>
#define MAXN 200000
#define eps 1e-6

using namespace std;
int c[MAXN+70],v[MAXN+70],g[MAXN+80],k;
bool chk(int tank,double time,int dis)
{
	int i;
	for(i=0;i<k;i++)
	{
		if(g[i+1]-g[i]>tank)
			return 0;
		if((g[i+1]-g[i])*2>=tank)
			time-=(3*(g[i+1]-g[i])-tank);
		else
			time-=(g[i+1]-g[i]);
		if(time<-eps)
			return 0;
	}
	return 1;
}
int main()
{
	int n,s,t,i,Min=-1;
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(i=1;i<=n;i++)
		scanf("%d%d",c+i,v+i);
	for(i=1;i<=k;i++)
		scanf("%d",g+i);
	g[++k]=s;
	sort(g+1,g+n+1);
	for(i=1;i<=n;i++)
		if(chk(v[i],t,s)&&(Min==-1||Min>c[i]))
			Min=c[i];
	printf("%d",Min);
	return 0;
}


#include <time.h>
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include<algorithm>
#define MAXN 200000
#define eps 1e-6

using namespace std;
int g[MAXN+80],k;
struct node
{
	int c,v;
	bool operator <(const node &x)const
	{
		return c<x.c;
	}
}array[MAXN+70];
bool chk(int tank,double time)
{
	int i;
	for(i=0;i<k;i++)
	{
		if(g[i+1]-g[i]>tank)
			return 0;
		if((g[i+1]-g[i])*2>=tank)
			time-=(3*(g[i+1]-g[i])-tank);
		else
			time-=(g[i+1]-g[i]);
		if(time<-eps)
			return 0;
	}
	return 1;
}
int main()
{
	int n,s,t,i,gap;
	scanf("%d%d%d%d",&n,&k,&s,&t);
	if(t<s)
	{
		printf("-1");
		return 0;
	}
	for(i=1;i<=n;i++)
		scanf("%d%d",&array[i].c,&array[i].v);
	for(i=1;i<=k;i++)
		scanf("%d",g+i);
	g[++k]=s;
	sort(g+1,g+k+1);
	sort(array+1,array+n+1);
	for(gap=g[1]-g[0],i=1;i<k;i++)
		gap=max(gap,g[i+1]-g[i]);
	for(i=1;i<=n;i++)
		if(array[i].v>=gap&&chk(array[i].v,t))
			break;
	printf("%d",i<=n?array[i].c:-1);
	return 0;
}


#include <time.h>
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include<algorithm>
#define MAXN 200000
#define eps 1e-6

using namespace std;
int c[MAXN+70],v[MAXN+70],g[MAXN+80],k;
bool chk(int tank,int time)
{
	int i;
	for(i=0;i<k;i++)
	{
		if(g[i+1]-g[i]>tank)
			return 0;
		if((g[i+1]-g[i])*2>=tank)
			time-=(3*(g[i+1]-g[i])-tank);
		else
			time-=(g[i+1]-g[i]);
		if(time<-eps)
			return 0;
	}
	return 1;
}
int main()
{
	int n,s,t,i,Min=-1,l=1<<30,mid,r=0;
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(i=1;i<=n;i++)
	{
		scanf("%d%d",c+i,v+i);
		l=min(l,v[i]);
		r=max(r,v[i]);
	}
	for(i=1;i<=k;i++)
		scanf("%d",g+i);
	g[++k]=s;
	sort(g+1,g+k+1);
	while(l<r)
	{
		mid=(l+r)>>1;
		if(chk(mid,t))
			r=mid;
		else
			l=mid+1;
	}
	if(chk(l,t))
		for(i=1;i<=n;i++)
			if(v[i]>=l&&(Min==-1||Min>c[i]))
				Min=c[i];
	printf("%d",Min);
	return 0;
}


#include <time.h>
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include<algorithm>
#define MAXN 200000
#define eps 1e-6

using namespace std;
int c[MAXN+70],v[MAXN+70],g[MAXN+80],k;
bool chk(int tank,int time)
{
	int i;
	for(i=0;i<k;i++)
	{
		if(g[i+1]-g[i]>tank)
			return 0;
		if((g[i+1]-g[i])*2>=tank)
			time-=(3*(g[i+1]-g[i])-tank);
		else
			time-=(g[i+1]-g[i]);
		if(time<-eps)
			return 0;
	}
	return 1;
}
int main()
{
	int n,s,t,i,Min=-1,l=1<<30,mid,r=0;
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(i=1;i<=n;i++)
	{
		scanf("%d%d",c+i,v+i);
		l=min(l,v[i]);
		r=max(r,v[i]);
	}
	for(i=1;i<=k;i++)
		scanf("%d",g+i);
	g[++k]=s;
	sort(g+1,g+k+1);
	while(l<r)
	{
		mid=(l+r)>>1;
		if(chk(mid,t))
			r=mid;
		else
			l=mid+1;
	}
	for(i=1;i<=n;i++)
		if(v[i]>=l&&(Min==-1||Min>c[i]))
			Min=c[i];
	printf("%d",Min);
	return 0;
}


#include <time.h>
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include<algorithm>
#define MAXN 200000
#define eps 1e-6

using namespace std;
int c[MAXN+70],v[MAXN+70],g[MAXN+80],k;
bool chk(int tank,double time,int dis)
{
	int i;
	for(i=0;i<k;i++)
	{
		if(g[i+1]-g[i]>tank)
			return 0;
		if((g[i+1]-g[i])*2>=tank)
			time-=(3*(g[i+1]-g[i])-tank);
		else
			time-=(g[i+1]-g[i]);
		if(time<-eps)
			return 0;
	}
	return 1;
}
int main()
{
	int n,s,t,i,Min=-1;
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(i=1;i<=n;i++)
		scanf("%d%d",c+i,v+i);
	for(i=1;i<=k;i++)
		scanf("%d",g+i);
	g[++k]=s;
	sort(g+1,g+k+1);
	for(i=1;i<=n;i++)
		if(chk(v[i],t,s)&&(Min==-1||Min>c[i]))
			Min=c[i];
	printf("%d",Min);
	return 0;
}


#include <time.h>
#include <conio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include<algorithm>
#define MAXN 200000
#define eps 1e-6

using namespace std;
int c[MAXN+70],v[MAXN+70],g[MAXN+80],k;
bool chk(int tank,double time,int dis)
{
	int i;
	for(i=0;i<k;i++)
	{
		if(g[i+1]-g[i]>tank)
			return 0;
		if((g[i+1]-g[i])*2>=tank)
			time-=(3*(g[i+1]-g[i])-tank);
		else
			time-=(g[i+1]-g[i]);
		if(time<-eps)
			return 0;
	}
	return 1;
}
int main()
{
	int n,s,t,i,Min=-1,gap;
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(i=1;i<=n;i++)
		scanf("%d%d",c+i,v+i);
	for(i=1;i<=k;i++)
		scanf("%d",g+i);
	g[++k]=s;
	sort(g+1,g+k+1);
	for(gap=g[1]-g[0],i=1;i<k;i++)
		gap=max(gap,g[i+1]-g[i]);
	for(i=1;i<=n;i++)
	{
		if(v[i]>=gap&&(Min==-1||Min>c[i])&&chk(v[i],t,s))
			Min=c[i];
	}
	printf("%d",Min);
	return 0;
}


#include <iostream>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <deque>
#include <bitset>
#include <algorithm>

using namespace std;

const double eps=1e-10;
const double pi=3.1415926535897932384626433832795;
const double eln=2.718281828459045235360287471352;

#define LL long long
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
#define scan(x) scanf("%d", &x)
#define scan2(x, y) scanf("%d%d", &x, &y)
#define scan3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define sqr(x) (x) * (x)
#define pr(x) printf("Case %d: ",x)
#define prn(x) printf("Case %d:\n",x)
#define prr(x) printf("Case #%d: ",x)
#define prrn(x) printf("Case #%d:\n",x)
#define lowbit(x) (x&(-x))

const int maxn=200005;
int i,j,m,n,s;
LL t;
struct car
{
    int cost,v;
}c[maxn];
int kk[maxn];

bool check(LL x)
{
    LL tot=0;
    for(int i=1;i<=m;i++)
    {
        LL t1=kk[i]-kk[i-1];
        if(2*t1<=x){tot+=t1;continue;}
        if(t1>x)return false;
        tot+=(x-t1)+2*(2*t1-x);
    }
    return tot<=t;
}

int find()
{
    LL l=1,r=1e9;
    while(r-l>1)
    {
        int mid=(l+r)>>1;
        if(check(mid))r=mid;else l=mid;
    }
    if(!check(l))l++;
    return l;
}

int main()
{
    scanf("%d%d%d%lld",&n,&m,&s,&t);
    for(i=1;i<=n;i++)scan2(c[i].cost,c[i].v);
    for(i=1;i<=m;i++)scanf("%d",&kk[i]);
    sort(kk+1,kk+m+1);
    kk[0]=0;kk[++m]=s;
    int d=find();
    int ans=1e9+7;
    //check(6);
    for(i=1;i<=n;i++)if(c[i].v>=d)ans=min(ans,c[i].cost);
    if(ans<1e9+7)printf("%d",ans);else printf("-1");
    return 0;
}


#include <iostream>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <deque>
#include <bitset>
#include <algorithm>

using namespace std;

const double eps=1e-10;
const double pi=3.1415926535897932384626433832795;
const double eln=2.718281828459045235360287471352;

#define LL long long
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
#define scan(x) scanf("%d", &x)
#define scan2(x, y) scanf("%d%d", &x, &y)
#define scan3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define sqr(x) (x) * (x)
#define pr(x) printf("Case %d: ",x)
#define prn(x) printf("Case %d:\n",x)
#define prr(x) printf("Case #%d: ",x)
#define prrn(x) printf("Case #%d:\n",x)
#define lowbit(x) (x&(-x))

const int maxn=200005;
int i,j,m,n,s;
LL t;
struct car
{
    int cost,v;
}c[maxn];
int kk[maxn];

bool check(LL x)
{
    LL tot=0;
    for(int i=1;i<=m;i++)
    {
        LL t1=kk[i]-kk[i-1];
        if(2*t1<=x){tot+=t1;continue;}
        if(t1>x)return false;
        tot+=(x-t1)+2*(2*t1-x);
    }
    return tot<=t;
}

int find()
{
    LL l=1,r=1e9;
    while(r-l>1)
    {
        int mid=(l+r)>>1;
        if(check(mid))r=mid;else l=mid;
    }
    if(!check(l))l++;
    return l;
}

int main()
{
    scanf("%d%d%d%lld",&n,&m,&s,&t);
    for(i=1;i<=n;i++)scan2(c[i].cost,c[i].v);
    for(i=1;i<=m;i++)scanf("%d",&kk[i]);
    sort(kk+1,kk+m+1);
    kk[0]=0;kk[++m]=s;
    int d=find();
    int ans=1e9+7;
    //check(6);
    for(i=1;i<=n;i++)if(c[i].v>=d)ans=min(ans,c[i].cost);
    if(ans==1e9+7)printf("%d",ans);else printf("-1");
    return 0;
}


#include <iostream>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <deque>
#include <bitset>
#include <algorithm>

using namespace std;

const double eps=1e-10;
const double pi=3.1415926535897932384626433832795;
const double eln=2.718281828459045235360287471352;

#define LL long long
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
#define scan(x) scanf("%d", &x)
#define scan2(x, y) scanf("%d%d", &x, &y)
#define scan3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define sqr(x) (x) * (x)
#define pr(x) printf("Case %d: ",x)
#define prn(x) printf("Case %d:\n",x)
#define prr(x) printf("Case #%d: ",x)
#define prrn(x) printf("Case #%d:\n",x)
#define lowbit(x) (x&(-x))

const int maxn=200005;
int i,j,m,n,s;
LL t;
struct car
{
    int cost,v;
}c[maxn];
int kk[maxn];

bool check(LL x)
{
    LL tot=0;
    for(int i=1;i<=m;i++)
    {
        LL t1=kk[i]-kk[i-1];
        if(2*t1<=x){tot+=t1;continue;}
        if(t1>x)return false;
        tot+=(x-t1)+2*(2*t1-x);
    }
    return tot<=t;
}

int find()
{
    LL l=1,r=1e9;
    while(r-l>1)
    {
        int mid=(l+r)>>1;
        if(check(mid))r=mid;else l=mid;
    }
    if(!check(l))l++;
    return l;
}

int main()
{
    scanf("%d%d%d%lld",&n,&m,&s,&t);
    for(i=1;i<=n;i++)scan2(c[i].cost,c[i].v);
    for(i=1;i<=m;i++)scanf("%d",&kk[i]);
    sort(kk+1,kk+m+1);
    kk[0]=0;kk[++m]=s;
    int d=find();
    int ans=1e9;
    //check(6);
    for(i=1;i<=n;i++)if(c[i].v>=d)ans=min(ans,c[i].cost);
    printf("%d",ans);
    return 0;
}


#include <iostream>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <deque>
#include <bitset>
#include <algorithm>

using namespace std;

const double eps=1e-10;
const double pi=3.1415926535897932384626433832795;
const double eln=2.718281828459045235360287471352;

#define LL long long
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
#define scan(x) scanf("%d", &x)
#define scan2(x, y) scanf("%d%d", &x, &y)
#define scan3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define sqr(x) (x) * (x)
#define pr(x) printf("Case %d: ",x)
#define prn(x) printf("Case %d:\n",x)
#define prr(x) printf("Case #%d: ",x)
#define prrn(x) printf("Case #%d:\n",x)
#define lowbit(x) (x&(-x))

const int maxn=200005;
int i,j,m,n,s;
LL t;
struct car
{
    int cost,v;
}c[maxn];
int kk[maxn];

bool check(LL x)
{
    LL tot=0;
    for(int i=1;i<=m;i++)
    {
        LL t1=kk[i]-kk[i-1];
        if(2*t1<=x){tot+=t1;continue;}
        if(t1>x)return false;
        tot+=(x-t1)+2*(2*t1-x);
    }
    return tot<=t;
}

int find()
{
    LL l=1,r=1e9+1;
    while(r-l>1)
    {
        int mid=(l+r)>>1;
        if(check(mid))r=mid;else l=mid;
    }
    if(!check(l))l++;
    return l;
}

int main()
{
    scanf("%d%d%d%lld",&n,&m,&s,&t);
    for(i=1;i<=n;i++)scan2(c[i].cost,c[i].v);
    for(i=1;i<=m;i++)scanf("%d",&kk[i]);
    sort(kk+1,kk+m+1);
    kk[0]=0;kk[++m]=s;
    int d=find();
    int ans=1e9+7;
    //check(6);
    for(i=1;i<=n;i++)if(c[i].v>=d)ans=min(ans,c[i].cost);
    if(ans<1e9+7)printf("%d",ans);else printf("-1");
    return 0;
}


#include <iostream>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <deque>
#include <bitset>
#include <algorithm>

using namespace std;

const double eps=1e-10;
const double pi=3.1415926535897932384626433832795;
const double eln=2.718281828459045235360287471352;

#define LL long long
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
#define scan(x) scanf("%d", &x)
#define scan2(x, y) scanf("%d%d", &x, &y)
#define scan3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define sqr(x) (x) * (x)
#define pr(x) printf("Case %d: ",x)
#define prn(x) printf("Case %d:\n",x)
#define prr(x) printf("Case #%d: ",x)
#define prrn(x) printf("Case #%d:\n",x)
#define lowbit(x) (x&(-x))

const int maxn=200005;
int i,j,k,l,m,n,s,t;
struct car
{
    int cost,v;
}c[maxn];
int kk[maxn];

bool check(int x)
{
    double xx=x;
    double tt=t;
    double tot=0;
    for(int i=1;i<=m;i++)
    {
        double t1=kk[i]-kk[i-1];
        if(2.0*t1<=xx){tot+=t1;continue;}
        if(t1>xx)return false;
        tot+=(xx-t1)+2.0*(2.0*t1-xx);
    }
    return tot<=tt;
}

int find()
{
    int l=0,r=1e9;
    while(r-l>1)
    {
        int mid=(l+r)>>1;
        if(check(mid))r=mid;else l=mid;
    }
    if(!check(l))l++;
    return l;
}

int main()
{
    scanf("%d%d%d%d",&n,&m,&s,&t);
    for(i=1;i<=n;i++)scan2(c[i].cost,c[i].v);
    for(i=1;i<=m;i++)scanf("%d",&kk[i]);
    sort(kk+1,kk+m+1);
    kk[0]=0;kk[++m]=s;
    int d=find();
    int ans=1e9;
    //check(6);
    for(i=1;i<=n;i++)if(c[i].v>=d)ans=min(ans,c[i].cost);
    printf("%d",ans);
    return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int maxN = 200002, INF = 2000000001;

pair <int, int> cars[maxN];
int k, gas[maxN];

int min_time(int cap)
{
    int t = 0;

    for (int i=0; i<=k; i++)
    {
        int d = gas[i + 1] - gas[i];

        if (cap < d)    return INF;
        t += (cap >= d * 2 ? d : d * 2 - (cap % d));
    }

    return t;
}

int main()
{
    int n, s, t;
    scanf ("%d%d%d%d", &n, &k, &s, &t);

    for (int i=0; i<n; i++)
        scanf ("%d%d", &cars[i].first, &cars[i].second);

    for (int i=1; i<=k; i++)
        scanf ("%d", gas + i);

    sort(gas, gas + k + 1);

    gas[k + 1] = s;

    int begin = 0, end = s * 2 + 1;

    while (end - begin > 1)
    {
        int middle = (begin + end) / 2;
        min_time(middle) <= t ? end = middle : begin = middle;
    }

    if (end == s * 2 + 1)
    {
        printf("-1\n");
        return 0;
    }

    int res = INF;

    for (int i=0; i<n; i++)
    {
        if (cars[i].second >= end)
            res = min(res, cars[i].first);
    }

    printf("%d\n", (res == INF ? -1 : res));

    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;
typedef double db;
const int maxn=2e5+10;
int n,m,s,t,c[maxn],v[maxn];
int g[maxn],tot;
LL sum[maxn],f[maxn];
int get(db x)
{
	int ret,l=1,r=tot,mid;
	while (l<=r)
	{
		mid=(l+r)/2;
		if (f[mid]<x)
		{
			ret=mid;
			l=mid+1;
		}
		else r=mid-1;
	}
	return ret;
}
bool check(int i)
{
	if (f[tot]>v[i]) return 0;
	if (2*f[1]>=v[i]) return 3*sum[tot]-(LL)tot*v[i]<=t;
	int j=get((db)v[i]/2);
	return sum[j]+3*(sum[tot]-sum[j])-(LL)(tot-j)*v[i]<=t;
}
int main()
{
	cin>>n>>m>>s>>t;
	for (int i=1;i<=n;i++) scanf("%d%d",&c[i],&v[i]);
	for (int i=1;i<=m;i++) scanf("%d",&g[i]);
	g[0]=0;g[m+1]=s;
	sort(g,g+m+2);
	for (int i=1;i<=m+1;i++)
	    if (g[i]-g[i-1])
	    {
	    	tot++;
	        f[tot]=g[i]-g[i-1];
	    }
	sort(f+1,f+tot+1);
	for (int i=1;i<=tot;i++) sum[i]=sum[i-1]+f[i];
	int ans=-1;
	for (int i=1;i<=n;i++)
	    if (check(i))
	    {
			if (ans==-1||ans>c[i]) ans=c[i];
	    }
	cout<<ans;
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
inline int read(){
	int x = 0; char ch = getchar(); bool positive = 1;
	for (; !isdigit(ch); ch = getchar())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = getchar())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(int a){
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(int a){
    write(a); puts("");
}
const int N=200005;
int n,k,m,t,price[N],sum[N],b[N];
inline bool check(int x){
	int sum=m;
	for(int i=1;i<=k;i++){
		int s=b[i]-b[i-1];
		if(x<s)return 0;
		sum+=max(s-x+s,0);
	}
	return sum<=t;
}
int main(){
    n=read(); k=read(); m=read(); t=read();
    for(int i=1;i<=n;i++){
    	price[i]=read(); sum[i]=read();
	}
	for(int i=1;i<=k;i++){
		b[i]=read();
	}b[++k]=m; sort(&b[1],&b[k+1]);
	int l=1,r=1000000001;
	while(l<r){
		int mid=l+r>>1;
		if(check(mid))r=mid; else l=mid+1;
	} //writeln(l);
	int ans=1000000001;
	for(int i=1;i<=n;i++)if(sum[i]>=l)ans=min(ans,price[i]);
	if(ans==1000000001){
		puts("-1"); return 0;
	}else{
		writeln(ans);
	}
}


#include <bits/stdtr1c++.h>

#define MAX 200010
#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)
#define dbg(x) cout << #x << " = " << x << endl
#define ran(a, b) ((((rand() << 15) ^ rand()) % ((b) - (a) + 1)) + (a))

using namespace std;

int n, m, s, t, price[MAX], fuel[MAX], gas[MAX], dp[MAX];

bool check(int lim){
    long long time_travelled = 0;
    int i, j, k, l, fuel_cap = dp[lim];

    for (i = 0; i <= m; i++){
        int dis = gas[i + 1] - gas[i];
        if (dis > fuel_cap) return false;

        if ((dis * 2) <= fuel_cap) time_travelled += dis;
        else{
            k = fuel_cap - dis;
            time_travelled += k;
            time_travelled += ((dis - k) * 2);
        }
    }

    return (time_travelled <= t);
}

int solve(){
    int i, j, k, l, low, high, mid, res;

    low = 0, high = n - 1;
    while ((low + 1) < high){
        mid = (low + high) >> 1;
        if (check(mid)) high = mid;
        else low = mid;
    }

    if (check(low)) return price[low];
    else if (check(high)) return price[high];
    else return -1;
}

int main(){
    int i, j, k, l, x, y, res;

    while (scanf("%d %d %d %d", &n, &m, &s, &t) != EOF){
        vector <pair<int, int> > v;
        for (i = 0; i < n; i++){
            scanf("%d %d", &x, &y);
            v.push_back(make_pair(x, y));
        }

        gas[0] = 0, gas[m + 1] = gas[m + 2] = s;
        for (i = 1; i <= m; i++) scanf("%d", &gas[i]);
        sort(gas, gas + m + 2);

        sort(v.begin(), v.end());
        for (i = 0; i < n; i++){
            price[i] = v[i].first;
            fuel[i] = v[i].second;
        }

        dp[0] = fuel[0];
        for (i = 1; i < n; i++) dp[i] = max(dp[i - 1], fuel[i]);

        printf("%d\n", solve());
    }
    return 0;
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
struct che{
	int c,v;
}a[220000];
int n,k,s,t;
long long w[220000];
bool PAN(long long x){
	long long tt=0;
	for(int i=0;i<=k;i++){
		long long del=w[i+1]-w[i];
		if(x>=2*del){
			tt+=del;
			continue;
		}
		if(x<del)return 0;
		tt+=3*del-x;
	}
	if(tt<=t)return 1;
	return 0;
}
int main(){
//	freopen("input.txt","r",stdin);
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(int i=1;i<=n;i++){
		scanf("%d%d",&a[i].c,&a[i].v);
	}
	for(int i=1;i<=k;i++){
		int x;
		scanf("%d",&x);
		w[i]=x;
	}
	sort(w+1,w+1+k);
	w[0]=0;
	w[k+1]=s;
	int maxx=0;
	for(int i=1;i<=n;i++)maxx=max(maxx,a[i].v);
	long long r=maxx,l=0;
	if(!PAN(r)){
		printf("FXCK\n");
		printf("-1\n");
		return 0;
	}
	long long mid;
	while(l+1<r){
		mid=(l+r)>>1;
		if(PAN(mid)){
			r=mid;
		}else{
			l=mid;
		}
	}
	int minn=1000000000;
	for(int i=1;i<=n;i++){
		if(a[i].v>=r)minn=min(minn,a[i].c);
	}
	printf("%d\n",minn);
	return 0;
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
struct che{
	int c,v;
}a[220000];
int n,k,s,t;
long long w[220000];
bool PAN(long long x){
	long long tt=0;
	for(int i=0;i<=k;i++){
		long long del=w[i+1]-w[i];
		if(x>=2*del){
			tt+=del;
			continue;
		}
		if(x<del)return 0;
		tt+=3*del-x;
	}
	if(tt<=t)return 1;
	return 0;
}
int main(){
//	freopen("input.txt","r",stdin);
	scanf("%d%d%d%d",&n,&k,&s,&t);
	for(int i=1;i<=n;i++){
		scanf("%d%d",&a[i].c,&a[i].v);
	}
	for(int i=1;i<=k;i++){
		int x;
		scanf("%d",&x);
		w[i]=x;
	}
	sort(w+1,w+1+k);
	w[0]=0;
	w[k+1]=s;
	int maxx=0;
	for(int i=1;i<=n;i++)maxx=max(maxx,a[i].v);
	long long r=maxx,l=0;
	if(!PAN(r)){
//		printf("FXCK\n");
		printf("-1\n");
		return 0;
	}
	long long mid;
	while(l+1<r){
		mid=(l+r)>>1;
		if(PAN(mid)){
			r=mid;
		}else{
			l=mid;
		}
	}
	int minn=1000000000;
	for(int i=1;i<=n;i++){
		if(a[i].v>=r)minn=min(minn,a[i].c);
	}
	printf("%d\n",minn);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<cstdlib>

typedef long long LL;
const LL N=200010;
LL n,k,s,tot,l,r,mid,pos[N],Time;
struct lr {
	LL v,c;
	bool operator <(const lr &a)const {
		return c!=a.c ? c<a.c : v>a.v;
	}
} a[N],b[N];

bool check(LL x) {
	LL t=0,s,del;
	for(LL i=1;i<=k;++i) {
		if(t>Time) return 0;
		s=pos[i]-pos[i-1];
		if(b[x].v<s) return 0;
		del=b[x].v-s;
		if(del>=s) {
			t+=s;
		}
		else {
			t+=s*2-del;
		}
	}
//	printf("%d %.0lf\n",b[x].v,t);
	if(t<=Time) return 1;
	return 0;
}

int main() {
	scanf("%I64d%I64d%I64d%I64d",&n,&k,&s,&Time);
	for(LL i=1;i<=n;++i) scanf("%I64d%I64d",&a[i].c,&a[i].v);
	for(LL i=1;i<=k;++i) scanf("%I64d",pos+i);
	pos[++k]=s;
	std::sort(pos+1,pos+1+k);
	std::sort(a+1,a+1+n);
	for(LL i=1;i<=n;++i)
		if(a[i].v<=a[i-1].v) continue;
		else b[++tot]=a[i];
	l=1; r=tot;
	while(l!=r) {
		mid=l+r >> 1;
		if(check(mid)) r=mid;
		else l=mid+1;
	}
	if(l>=tot && !check(l)) return puts("-1"),0;
	printf("%I64d\n",b[l].c);
//	for(;;);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<cstdlib>

typedef long long LL;
const LL N=200010;
LL n,k,s,tot,l,r,mid,pos[N],Time;
struct lr {
	LL v,c;
	bool operator <(const lr &a)const {
		return c<a.c;
	}
} a[N],b[N];

bool check(LL x) {
	LL t=0,s,del;
	for(LL i=1;i<=k;++i) {
		if(t>Time) return 0;
		s=pos[i]-pos[i-1];
		if(b[x].v<s) return 0;
		del=b[x].v-s;
		if(del>=s) {
			t+=s;
		}
		else {
			t+=s*2-del;
		}
	}
//	printf("%d %.0lf\n",b[x].v,t);
	if(t<=Time) return 1;
	return 0;
}

int main() {
	scanf("%I64d%I64d%I64d%I64d",&n,&k,&s,&Time);
	for(LL i=1;i<=n;++i) scanf("%I64d%I64d",&a[i].c,&a[i].v);
	for(LL i=1;i<=k;++i) scanf("%I64d",pos+i);
	pos[++k]=s;
	std::sort(pos+1,pos+1+k);
	std::sort(a+1,a+1+n);
	for(LL i=1;i<=n;++i)
		if(a[i].v<=a[i-1].v) continue;
		else b[++tot]=a[i];
	l=1; r=tot;
	while(l!=r) {
		mid=l+r >> 1;
		if(check(mid)) r=mid;
		else l=mid+1;
	}
	if(l>=tot && !check(l)) return puts("-1"),0;
	printf("%I64d\n",b[l].c);
//	for(;;);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<cstdlib>

typedef long long LL;
const LL N=300010;
LL n,k,s,tot,l,r,mid,pos[N],Time;
struct lr {
	LL v,c;
	bool operator <(const lr &a)const {
		return c!=a.c ? c<a.c : v>a.v;
	}
} a[N],b[N];

bool check(LL x) {
	LL t=0,s,del;
	for(LL i=1;i<=k;++i) {
		if(t>Time) return 0;
		s=pos[i]-pos[i-1];
		if(b[x].v<s) return 0;
		del=b[x].v-s;
		if(del>=s) {
			t+=s;
		}
		else {
			t+=s*2-del;
		}
	}
//	printf("%d %.0lf\n",b[x].v,t);
	if(t<=Time) return 1;
	return 0;
}

int main() {
	scanf("%I64d%I64d%I64d%I64d",&n,&k,&s,&Time);
	for(LL i=1;i<=n;++i) scanf("%I64d%I64d",&a[i].c,&a[i].v);
	//for(LL i=1;i<=k;++i) scanf("%I64d",pos+i);
	pos[++k]=s;
	std::sort(pos+1,pos+1+k);
	std::sort(a+1,a+1+n);
	for(LL i=1;i<=n;++i)
		if(a[i].v<=b[tot].v) continue;
		else b[++tot]=a[i];
	l=1; r=tot;
	while(l!=r) {
		mid=l+r >> 1;
		if(check(mid)) r=mid;
		else l=mid+1;
	}
	if(l>=tot && !check(l)) return puts("-1"),0;
	printf("%I64d\n",b[l].c);
	//for(;;);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<cstdlib>

typedef long long LL;
const LL N=300010;
LL n,k,s,tot,l,r,mid,pos[N],Time;
struct lr {
	LL v,c;
	bool operator <(const lr &a)const {
		return c!=a.c ? c<a.c : v>a.v;
	}
} a[N],b[N];

bool check(LL x) {
	LL t=0,s,del;
	for(LL i=1;i<=k;++i) {
		if(t>Time) return 0;
		s=pos[i]-pos[i-1];
		if(b[x].v<s) return 0;
		del=b[x].v-s;
		if(del>=s) {
			t+=s;
		}
		else {
			t+=s*2-del;
		}
	}
//	printf("%d %.0lf\n",b[x].v,t);
	if(t<=Time) return 1;
	return 0;
}

int main() {
	scanf("%I64d%I64d%I64d%I64d",&n,&k,&s,&Time);
	for(LL i=1;i<=n;++i) scanf("%I64d%I64d",&a[i].c,&a[i].v);
	for(LL i=1;i<=k;++i) scanf("%I64d",pos+i);
	pos[++k]=s;
	std::sort(pos+1,pos+1+k);
	std::sort(a+1,a+1+n);
	for(LL i=1;i<=n;++i)
		if(a[i].v<=b[tot].v) continue;
		else b[++tot]=a[i];
	l=1; r=tot;
	while(l!=r) {
		mid=l+r >> 1;
		if(check(mid)) r=mid;
		else l=mid+1;
	}
	if(l>=tot && !check(l)) return puts("-1"),0;
	printf("%I64d\n",b[l].c);
	//for(;;);
	return 0;
}


#include<cstdio>
#include<iostream>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<list>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<iomanip>
#include<fstream>
#include<ctime>
using namespace std;
typedef vector<int> VI;
typedef pair <int,int> ii;
typedef long long LL;
#define pb push_back
const int INF = 2147483647;
const int N = 200005;

int n,k,s,t,x,tab[N], c[N], v[N], i, minn;

bool can(int x) {
	int i, d;
	LL res;
	res = 0;
	for (i=1;i<k;i++) {
		d = tab[i] - tab[i-1];
		if (d > x) {
			return false;
		}
		if (d * 2LL <= x) {
			res += d;
		} else {
			res += (3LL * d - x);
		}
	}
	return res <= t;
}

int find(int l, int r) {
	if (l == r) {
		return l;
	}
	int index = (l * 1LL + r) / 2;
	if (can(index)) {
		return find(l, index);
	}
	return find(index + 1, r);
}

int main() {
scanf("%d %d %d %d",&n, &k, &s, &t);
for (i=0;i<n;i++) {
	scanf("%d %d",&c[i], &v[i]);
}
for (i=0;i<k;i++) {
	scanf("%d",&tab[i]);
}
tab[k] = 0;
k++;
tab[k] = s;
k++;
sort(tab, tab + k);
if (t < s) {
	printf("-1\n");
	return 0;
}
x = find(1, 2 * s);
minn = INF;
for (i=0;i<n;i++) {
	if (v[i] >= x) {
		minn = min(minn, c[i]);
	}
}
if (minn == INF) {
	printf("-1\n");
} else {
	printf("%d\n", minn);
}
return 0;
}


#include<cstdio>
#include<iostream>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<list>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<iomanip>
#include<fstream>
#include<ctime>
using namespace std;
typedef vector<int> VI;
typedef pair <int,int> ii;
typedef long long LL;
#define pb push_back
const int INF = 2147483647;
const int N = 200005;

int n,k,s,t,x,tab[N], c[N], v[N], i, minn;

bool can(int x) {
	int i, d;
	LL res;
	res = 0;
	for (i=1;i<k;i++) {
		d = tab[i] - tab[i-1];
		if (d > x) {
			return false;
		}
		if (d * 2LL <= x) {
			res += d;
		} else {
			res += (3LL * d - x);
		}
	}
	return res <= t;
}

int find(int l, int r) {
	if (l == r) {
		return l;
	}
	int index = (l + r) / 2;
	if (can(index)) {
		return find(l, index);
	}
	return find(index + 1, r);
}

int main() {
scanf("%d %d %d %d",&n, &k, &s, &t);
for (i=0;i<n;i++) {
	scanf("%d %d",&c[i], &v[i]);
}
for (i=0;i<k;i++) {
	scanf("%d",&tab[i]);
}
tab[k] = 0;
k++;
tab[k] = s;
k++;
sort(tab, tab + k);
if (t < s) {
	printf("-1\n");
	return 0;
}
x = find(1, s);
minn = INF;
for (i=0;i<n;i++) {
	if (v[i] >= x) {
		minn = min(minn, c[i]);
	}
}
if (minn == INF) {
	printf("-1\n");
} else {
	printf("%d\n", minn);
}
return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>

using namespace std;

const int limite=1000000;

typedef long long int ll;

ll n,k,s,t;
ll g[limite];

bool puede(int c)
{
  //cout<<"puede "<<c<<endl;
  ll tt=0;
  for (int i=1;i<=k;i++) {
    ll d=g[i]-g[i-1];
    //cout<<"d "<<d<<endl;
    if (d>c) return false;
    if (2*d<=c) tt+=d;
    else {
      ll d2=c-d;
      ll d1=d-d2;
      tt+=2*d1+d2;
      //cout<<"d1 "<<d1<<" d2 "<<d2<<" tt "<<tt<<endl;
    }
  }
  return tt<=t;
}

ll coste[limite],capacidad[limite];

vector<pair<ll,ll> > v;

int main()
{
  ios::sync_with_stdio(false);
  cin>>n>>k>>s>>t;
  for (int i=1;i<=n;i++) {
    cin>>coste[i]>>capacidad[i];
    v.push_back(pair<ll,ll> (coste[i],capacidad[i]));
  }
  sort(v.begin(),v.end());
  /*
  for (int i=0;i<int(v.size());i++)
    cout<<"("<<v[i].first<<","<<v[i].second<<")";
  cout<<endl;
  */
  for (int i=1;i<=k;i++)
    cin>>g[i];
  k++;
  g[k]=s;
  sort(g,g+(k+1));
  ll capacidadnecesaria;
  {
    ll inf=0;
    ll sup=2*s+2*t;
    while (inf+1<sup) {
      ll med=(inf+sup)/2;
      if (puede(med)) sup=med;
      else inf=med;
    }
    capacidadnecesaria=sup;
  }
  //cout<<capacidadnecesaria<<endl;
  for (int i=0;i<int(v.size());i++) {
    if (v[i].second>=capacidadnecesaria) {
      cout<<v[i].first<<endl;
      exit(0);
    }
  }
  cout<<-1<<endl;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>

using namespace std;

const int limite=1000000;

typedef long long int ll;

ll n,k,s,t;
ll g[limite];

bool puede(int c)
{
  //cout<<"puede "<<c<<endl;
  ll tt=0;
  for (int i=1;i<=k;i++) {
    ll d=g[i]-g[i-1];
    //cout<<"d "<<d<<endl;
    if (d>c) return false;
    if (2*d<=c) tt+=d;
    else {
      ll d2=c-d;
      ll d1=d-d2;
      tt+=2*d1+d2;
      //cout<<"d1 "<<d1<<" d2 "<<d2<<" tt "<<tt<<endl;
    }
  }
  return tt<=t;
}

ll coste[limite],capacidad[limite];

vector<pair<ll,ll> > v;

int main()
{
  ios::sync_with_stdio(false);
  cin>>n>>k>>s>>t;
  for (int i=1;i<=n;i++) {
    cin>>coste[i]>>capacidad[i];
    v.push_back(pair<ll,ll> (coste[i],capacidad[i]));
  }
  sort(v.begin(),v.end());
  /*
  for (int i=0;i<int(v.size());i++)
    cout<<"("<<v[i].first<<","<<v[i].second<<")";
  cout<<endl;
  */
  for (int i=1;i<=k;i++)
    cin>>g[i];
  k++;
  g[k]=s;
  sort(g,g+(k+1));
  ll capacidadnecesaria;
  {
    ll inf=0;
    ll sup=s+1;
    while (inf+1<sup) {
      ll med=(inf+sup)/2;
      if (puede(med)) sup=med;
      else inf=med;
    }
    capacidadnecesaria=sup;
  }
  //cout<<capacidadnecesaria<<endl;
  for (int i=0;i<int(v.size());i++) {
    if (v[i].second>=capacidadnecesaria) {
      cout<<v[i].first<<endl;
      exit(0);
    }
  }
  cout<<-1<<endl;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>

using namespace std;

const int limite=1000000;

typedef long long int ll;

ll n,k,s,t;
ll g[limite];

bool puede(int c)
{
  //cout<<"puede "<<c<<endl;
  ll tt=0;
  for (int i=1;i<=k;i++) {
    ll d=g[i]-g[i-1];
    //cout<<"d "<<d<<endl;
    if (d>c) return false;
    if (2*d<=c) tt+=d;
    else {
      ll d2=c-d;
      ll d1=d-d2;
      tt+=2*d1+d2;
      //cout<<"d1 "<<d1<<" d2 "<<d2<<" tt "<<tt<<endl;
    }
  }
  return tt<=t;
}

ll coste[limite],capacidad[limite];

vector<pair<ll,ll> > v;

int main()
{
  ios::sync_with_stdio(false);
  cin>>n>>k>>s>>t;
  for (int i=1;i<=n;i++) {
    cin>>coste[i]>>capacidad[i];
    v.push_back(pair<ll,ll> (coste[i],capacidad[i]));
  }
  sort(v.begin(),v.end());
  /*
  for (int i=0;i<int(v.size());i++)
    cout<<"("<<v[i].first<<","<<v[i].second<<")";
  cout<<endl;
  */
  for (int i=1;i<=k;i++)
    cin>>g[i];
  k++;
  g[k]=s;
  sort(g,g+(k+1));
  ll capacidadnecesaria;
  {
    ll inf=0;
    ll sup=s+1;//2*s+2*t;
    while (inf+1<sup) {
      ll med=(inf+sup)/2;
      if (puede(med)) sup=med;
      else inf=med;
    }
    capacidadnecesaria=sup;
  }
  //cout<<capacidadnecesaria<<endl;
  for (int i=0;i<int(v.size());i++) {
    if (v[i].second>=capacidadnecesaria) {
      cout<<v[i].first<<endl;
      exit(0);
    }
  }
  cout<<-1<<endl;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>

using namespace std;

const int limite=1000000;

typedef long long int ll;

ll n,k,s,t;
ll g[limite];

bool puede(int c)
{
  //cout<<"puede "<<c<<endl;
  ll tt=0;
  for (int i=1;i<=k;i++) {
    ll d=g[i]-g[i-1];
    //cout<<"d "<<d<<endl;
    if (d>c) return false;
    if (2*d<=c) tt+=d;
    else {
      ll d2=c-d;
      ll d1=d-d2;
      tt+=2*d1+d2;
      //cout<<"d1 "<<d1<<" d2 "<<d2<<" tt "<<tt<<endl;
    }
  }
  return tt<=t;
}

ll coste[limite],capacidad[limite];

vector<pair<ll,ll> > v;

int main()
{
  ios::sync_with_stdio(false);
  cin>>n>>k>>s>>t;
  for (int i=1;i<=n;i++) {
    cin>>coste[i]>>capacidad[i];
    v.push_back(pair<ll,ll> (coste[i],capacidad[i]));
  }
  sort(v.begin(),v.end());
  /*
  for (int i=0;i<int(v.size());i++)
    cout<<"("<<v[i].first<<","<<v[i].second<<")";
  cout<<endl;
  */
  for (int i=1;i<=k;i++)
    cin>>g[i];
  k++;
  g[k]=s;
  sort(g,g+(k+1));
  ll capacidadnecesaria;
  {
    ll inf=0;
    ll sup=s+1+s;
    while (inf+1<sup) {
      ll med=(inf+sup)/2;
      if (puede(med)) sup=med;
      else inf=med;
    }
    capacidadnecesaria=sup;
  }
  //cout<<capacidadnecesaria<<endl;
  for (int i=0;i<int(v.size());i++) {
    if (v[i].second>=capacidadnecesaria) {
      cout<<v[i].first<<endl;
      exit(0);
    }
  }
  cout<<-1<<endl;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>

using namespace std;

const int limite=1000000;

typedef long long int ll;

ll n,k,s,t;
ll g[limite];

bool puede(int c)
{
  ll tt=0;
  for (int i=1;i<=k;i++) {
    ll d=g[i]-g[i-1];
    if (d>c) return false;
    if (2*d<=c) {
      tt+=d;
    } else {
      ll d2=c-d;
      ll d1=d-d2;
      tt+=2*d1+d2;
    }
  }
  return tt<=t;
}

ll coste[limite],capacidad[limite];

vector<pair<ll,ll> > v;

int main()
{
  ios::sync_with_stdio(false);
  cin>>n>>k>>s>>t;
  ll maxcapacidad=0;
  for (int i=1;i<=n;i++) {
    cin>>coste[i]>>capacidad[i];
    v.push_back(pair<ll,ll> (coste[i],capacidad[i]));
    maxcapacidad=max(maxcapacidad,capacidad[i]);
  }
  sort(v.begin(),v.end());
  /*
  for (int i=0;i<int(v.size());i++)
    cout<<"("<<v[i].first<<","<<v[i].second<<")";
  cout<<endl;
  */
  for (int i=1;i<=k;i++)
    cin>>g[i];
  k++;
  g[k]=s;
  sort(g,g+(k+1));
  ll capacidadnecesaria;
  {
    ll inf=0;
    ll sup=maxcapacidad+1;
    while (inf+1<sup) {
      ll med=(inf+sup)/2;
      if (puede(med)) sup=med;
      else inf=med;
    }
    capacidadnecesaria=sup;
  }
  //cout<<capacidadnecesaria<<endl;
  for (int i=0;i<int(v.size());i++) {
    if (v[i].second>=capacidadnecesaria) {
      cout<<v[i].first<<endl;
      exit(0);
    }
  }
  cout<<-1<<endl;
}


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

const int MAXN = 200005;
int g[MAXN];
int p[MAXN];
int c[MAXN];
int dis[MAXN];
int dis2[MAXN];
int ds[MAXN];
int main()
{
    int n, k, s, t;
    scanf("%d %d %d %d", &n, &k, &s, &t);
    for (int i = 0; i < n; i++)
        scanf("%d %d", p + i, c + i);
    for (int i = 0; i < k; i++)
        scanf("%d", g + i);
    sort(g, g + k);
    for (int i = 0; i < k; i++)
    {
        dis[i] = g[i];
        if (i)
            dis[i] -= g[i-1];
        dis2[i] = 2*dis[i];
    }
    dis[k] = s - g[k-1];
    dis2[k] = 2*dis[k];
    sort(dis, dis + k + 1);
    sort(dis2, dis2 + k + 1);
    ds[0] = dis[0];
    for (int i = 1; i <= k; i++)
        ds[i] = dis[i] + ds[i-1];
    int mn = 1000000005;
    for (int i = 0; i < n; i++)
    {
        if (c[i] < dis[k])
            continue;
        long long save = 0;
        int ind = upper_bound(dis2, dis2 + k + 1, c[i]) - dis2;
        ind--;
        if (ind >= 0)
            save += ds[ind];
        int rem = k - ind;
        int rest = ds[k];
        if (ind >= 0)
            rest -= ds[ind];
        save += rem*1ll*c[i] - rest;
        if (2*s - save <= t)
            mn = min(mn, p[i]);
    }
    if (mn <= 1000000000)
        printf("%d\n", mn);
    else
        printf("-1\n");
}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int a[200005];
int vis[200005];
int main(){
    int n,s;
    cin>>n>>s;
    memset(vis,0,sizeof(vis));
    for(int i=1;i<=n;i++){
        scanf("%d",a+i);
        if(i==s)continue ;
        vis[a[i]]++;
    }
    int sum=0;
    if(a[s])sum++;
    int ans=1;
    for(int i=1;i<n;i++){
        if(ans>=n)break;
        if(vis[i]==0){
            vis[i]++;
            sum++;
        }
        ans+=vis[i];
    }
    cout<<sum<<endl;
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
const int MAXN=200010;
int n,k,s,t;
int gas[MAXN];
struct Node
{
    int c,v;
    friend bool operator<(const Node &p,const Node &q)
    {
        return p.c<q.c;
    }
}P[MAXN];
int pre[MAXN];
int check(int o)
{
    int tt=0;
    for(int i=1;i<=k;i++)
    {
        int x=gas[i]-gas[i-1];
        if(o<x) return 2147483647;
        tt+=max(x,2*x-(o-x));
    }
    return tt;
}
int main()
{
    scanf("%d%d%d%d",&n,&k,&s,&t);
    for(int i=1;i<=n;i++) scanf("%d%d",&P[i].c,&P[i].v);
    for(int i=1;i<=k;i++) scanf("%d",&gas[i]);
    sort(gas+1,gas+k+1);
    gas[++k]=s;
    int l=1,r=n;
    sort(P+1,P+n+1);
    for(int i=1;i<=n;i++) pre[i]=max(pre[i-1],P[i].v);
    while(l<r)
    {
        int mid=(l+r)>>1;
        int o=pre[mid];
        int tt=check(o);
        if(tt<=t) r=mid;
        else l=mid+1;
    }
    if(check(pre[l])>t) puts("-1");
    else printf("%d\n",P[l].c);
    return 0;
}


/**/
#include <bits/stdc++.h>
using namespace std;
/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compile and get accepted.
 *  ___  __     _______    _______
 * |\  \|\  \  |\  ___ \  |\  ___ \
 * \ \  \/  /|_\ \   __/| \ \   __/|
 *  \ \   ___  \\ \  \_|/__\ \  \_|/__
 *   \ \  \\ \  \\ \  \_|\ \\ \  \_|\ \
 *    \ \__\\ \__\\ \_______\\ \_______\
 *     \|__| \|__| \|_______| \|_______|
 */
const long long mod = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	long long N,K,s,t,gas,res = LLONG_MAX;
	cin>>N>>K>>s>>t;
	vector<pair<long long,long long> > cars(N);
	vector<long long> g,d,sum;
	for(int i = 0;i < N;i++) {
		cin>>cars[i].first>>cars[i].second;
	}
	g.push_back(0);
	for(int i = 0;i < K;i++) {
		cin>>gas;
		g.push_back(gas);
	}
	g.push_back(s);
	sort(g.begin(),g.end());

	for(int i = 1;i < (int)g.size();i++) {
		d.push_back(g[i] - g[i-1]);
	}

	sort(d.begin(),d.end());
	for(int i = 0;i < (int)d.size();i++) {
		sum.push_back(sum.empty()?0:sum.back());
		sum.back() += d.back();
	}
	for(int i = 0;i < N;i++) {
		long long p = cars[i].first,v = cars[i].second;
		if(v < d.back())
			continue;
		long long cur = 2ll * s;
		//		cerr<<cur<<endl;
		long long it = upper_bound(d.begin(),d.end(),v/2) - d.begin();
		if(it)
			cur -= sum[it - 1];
		//		cerr<<cur<<' '<<it<<endl;
		cur -= ((long long)d.size() - it) * v - (sum.back() - (it?sum[it-1]:0ll));
		//		cerr<<cur<<' '<<(d.size() - it) * v<<' '<<(sum.back() - (it?sum[it-1]:0))<<endl;
		if(cur <= t)
			res = min(res,p);
	}
	if(res == LLONG_MAX)
		cout<<"-1\n";
	else
		cout<<res<<'\n';
	return 0;
}
/**/


/**/
#include <bits/stdc++.h>
using namespace std;
/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compile and get accepted.
 *  ___  __     _______    _______
 * |\  \|\  \  |\  ___ \  |\  ___ \
 * \ \  \/  /|_\ \   __/| \ \   __/|
 *  \ \   ___  \\ \  \_|/__\ \  \_|/__
 *   \ \  \\ \  \\ \  \_|\ \\ \  \_|\ \
 *    \ \__\\ \__\\ \_______\\ \_______\
 *     \|__| \|__| \|_______| \|_______|
 */
const long long mod = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	long long N,K,s,t,gas,res = LLONG_MAX;
	cin>>N>>K>>s>>t;
	vector<pair<long long,long long> > cars(N);
	vector<long long> g,d,sum;
	for(int i = 0;i < N;i++) {
		cin>>cars[i].first>>cars[i].second;
	}
	g.push_back(0);
	for(int i = 0;i < K;i++) {
		cin>>gas;
		g.push_back(gas);
	}
	g.push_back(s);
	sort(g.begin(),g.end());

	sort(d.begin(),d.end());
	for(int i = 1;i < (int)g.size();i++) {
		d.push_back(g[i] - g[i-1]);
		sum.push_back(sum.empty()?0:sum.back());
		sum.back() += d.back();
	}

	for(int i = 0;i < N;i++) {
		long long p = cars[i].first,v = cars[i].second;
		if(v < d.back())
			continue;
		long long cur = 2ll * s;
//		cerr<<cur<<endl;
		long long it = upper_bound(d.begin(),d.end(),v/2) - d.begin();
		if(it)
			cur -= sum[it - 1];
//		cerr<<cur<<' '<<it<<endl;
		cur -= ((long long)d.size() - it) * v - (sum.back() - (it?sum[it-1]:0ll));
//		cerr<<cur<<' '<<(d.size() - it) * v<<' '<<(sum.back() - (it?sum[it-1]:0))<<endl;
		if(cur <= t)
			res = min(res,p);
	}
	if(res == LLONG_MAX)
		cout<<"-1\n";
	else
		cout<<res<<'\n';
	return 0;
}
/**/


/**/
#include <bits/stdc++.h>
using namespace std;
/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compile and get accepted.
 *  ___  __     _______    _______
 * |\  \|\  \  |\  ___ \  |\  ___ \
 * \ \  \/  /|_\ \   __/| \ \   __/|
 *  \ \   ___  \\ \  \_|/__\ \  \_|/__
 *   \ \  \\ \  \\ \  \_|\ \\ \  \_|\ \
 *    \ \__\\ \__\\ \_______\\ \_______\
 *     \|__| \|__| \|_______| \|_______|
 */
const long long mod = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	long long N,K,s,t,gas,res = LLONG_MAX;
	cin>>N>>K>>s>>t;
	vector<pair<long long,long long> > cars(N);
	vector<long long> g,d,sum;
	for(int i = 0;i < N;i++) {
		cin>>cars[i].first>>cars[i].second;
	}
	g.push_back(0);
	for(int i = 0;i < K;i++) {
		cin>>gas;
		g.push_back(gas);
	}
	g.push_back(s);
	sort(g.begin(),g.end());

	for(int i = 1;i < (int)g.size();i++) {
		d.push_back(g[i] - g[i-1]);
	}

	sort(d.begin(),d.end());
	for(int i = 0;i < (int)d.size();i++) {
		sum.push_back(sum.empty()?0:sum.back());
		sum.back() += d[i];
	}
	for(int i = 0;i < N;i++) {
		long long p = cars[i].first,v = cars[i].second;
		if(v < d.back())
			continue;
		long long cur = 2ll * s;
		//		cerr<<cur<<endl;
		long long it = upper_bound(d.begin(),d.end(),v/2) - d.begin();
		if(it)
			cur -= sum[it - 1];
		//		cerr<<cur<<' '<<it<<endl;
		cur -= ((long long)d.size() - it) * v - (sum.back() - (it?sum[it-1]:0ll));
		//		cerr<<cur<<' '<<(d.size() - it) * v<<' '<<(sum.back() - (it?sum[it-1]:0))<<endl;
		if(cur <= t)
			res = min(res,p);
	}
	if(res == LLONG_MAX)
		cout<<"-1\n";
	else
		cout<<res<<'\n';
	return 0;
}
/**/


/**/
#include <bits/stdc++.h>
using namespace std;
/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compile and get accepted.
 *  ___  __     _______    _______
 * |\  \|\  \  |\  ___ \  |\  ___ \
 * \ \  \/  /|_\ \   __/| \ \   __/|
 *  \ \   ___  \\ \  \_|/__\ \  \_|/__
 *   \ \  \\ \  \\ \  \_|\ \\ \  \_|\ \
 *    \ \__\\ \__\\ \_______\\ \_______\
 *     \|__| \|__| \|_______| \|_______|
 */
const long long mod = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	long long N,K,s,t,gas,res = LLONG_MAX;
	cin>>N>>K>>s>>t;
	vector<pair<long long,long long> > cars(N);
	vector<long long> g,d,sum;
	for(int i = 0;i < N;i++) {
		cin>>cars[i].first>>cars[i].second;
	}
	g.push_back(0);
	for(int i = 0;i < K;i++) {
		cin>>gas;
		g.push_back(gas);
	}
	g.push_back(s);
	sort(g.begin(),g.end());

	for(int i = 1;i < (int)g.size();i++) {
		d.push_back(g[i] - g[i-1]);
		sum.push_back(sum.empty()?0:sum.back());
		sum.back() += d.back();
	}

	sort(d.begin(),d.end());
	for(int i = 0;i < N;i++) {
		long long p = cars[i].first,v = cars[i].second;
		if(cars[i].second < d.back())
			continue;
		long long cur = 2 * s;
//		cerr<<cur<<endl;
		auto it = upper_bound(d.begin(),d.end(),v/2) - d.begin();
		if(it)
			cur -= sum[it - 1];
//		cerr<<cur<<' '<<it<<endl;
		cur -= (d.size() - it) * v - (sum.back() - (it?sum[it-1]:0));
//		cerr<<cur<<' '<<(d.size() - it) * v<<' '<<(sum.back() - (it?sum[it-1]:0))<<endl;
		if(cur <= t)
			res = min(res,p);
	}
	if(res == LLONG_MAX)
		cout<<"-1\n";
	else
		cout<<res<<'\n';
	return 0;
}
/**/


#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <bitset>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

int main() {
    int n, k, s, t;
    cin >> n >> k >> s >> t;
    vector<int> c(n);
    vector<int> v(n);
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d%d", &c[i], &v[i]);
        a[i] = c[i];
    }
    vector<int> g;
    g.push_back(0);
    for (int i = 0; i < k; ++i) {
        int x;
        scanf("%d", &x);
        g.push_back(x);
    }
    g.push_back(s);
    k += 2;
    sort(g.begin(), g.end());
    sort(a.begin(), a.end());
    int l = -1, r = (int)a.size();
    while (r - l > 1) {
        int m = (l + r) / 2;
        int curc = a[m];
        int maxv = -1;
        for (int i = 0; i < n; ++i)
            if (c[i] <= curc) {
                maxv = max(maxv, v[i]);
            }
        long long curt = 0;
        bool f = true;
        for (int i = 1; i < k; ++i) {
            int len = g[i] - g[i - 1];
            if (len * 2 <= maxv) {
                curt += len;
                continue;
            }
            if (len > maxv) {
                f = false;
                break;
            }
            int x = maxv - len;
            curt += x + 2 * (len - x);
        }
        if (curt > t)
            f = false;
        if (f)
            r = m;
        else
            l = m;
    }
    if (r != (int)a.size()) {
        cout << a[r] << endl;
    } else {
        cout << -1 << endl;
    }
}


#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <bitset>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

int main() {
    int n, k, s, t;
    cin >> n >> k >> s >> t;
    vector<int> c(n);
    vector<int> v(n);
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        scanf("%d%d", &c[i], &v[i]);
        a[i] = c[i];
    }
    vector<int> g;
    g.push_back(0);
    for (int i = 0; i < k; ++i) {
        int x;
        scanf("%d", &x);
        g.push_back(x);
    }
    g.push_back(s);
    k += 2;
    sort(g.begin(), g.end());
    sort(a.begin(), a.end());
    int l = -1, r = (int)a.size();
    while (r - l > 1) {
        int m = (l + r) / 2;
        int curc = a[m];
        int maxv = -1;
        for (int i = 0; i < n; ++i)
            if (c[i] <= curc) {
                maxv = max(maxv, v[i]);
            }
        long long curt = 0;
        bool f = true;
        for (int i = 1; i < k; ++i) {
            int len = g[i] - g[i - 1];
            if (len * 2 <= maxv) {
                curt += len;
                continue;
            }
            if (len >= maxv) {
                f = false;
                break;
            }
            int x = maxv - len;
            curt += x + 2 * (len - x);
        }
        if (curt > t)
            f = false;
        if (f)
            r = m;
        else
            l = m;
    }
    if (r != (int)a.size()) {
        cout << a[r] << endl;
    } else {
        cout << -1 << endl;
    }
}


#include <bits/stdc++.h>
#define N 200005
using namespace std;
typedef long long ll;
struct car{
    ll c,v;
}a[N];
ll b[N];
vector<ll> vc;
int main()
{
    int n,k; ll s,t; scanf("%d%d%lld%lld",&n,&k,&s,&t);
    for(int i=0;i<n;i++){
        ll c,v; scanf("%lld%lld",&c,&v);
        a[i]={c,v};
    }
    for(int i=1;i<=k;i++)
        scanf("%lld",b+i);
    b[k+1]=s;
    sort(b+1,b+k+1);
    ll accels=max(s+s-t,0LL);
    if(accels>s){
        printf("-1"); return 0;
    }
    for(int i=0;i<=k;i++){
        vc.push_back(b[i+1]-b[i]);
    }
    sort(vc.begin(),vc.end());
    ll fuels=vc.back();
    for(ll x: vc){
        if(accels<=x){
            fuels=max(fuels,x+accels);
            accels=0;
        }
        else{
            fuels=max(fuels,x+x);
            accels-=x;
        }
    }
    if(accels>0){
        printf("-1"); return 0;
    }
    ll ans=(1LL<<62);
    for(int i=0;i<n;i++){
        if(a[i].v>=fuels) ans=min(ans,a[i].c);
    }
    if(ans==(1LL<<62)) printf("-1");
    else printf("%lld",ans);
    return 0;
}


#include <bits/stdc++.h>
#define N 200005
using namespace std;
typedef long long ll;
struct car{
    ll c,v;
}a[N];
ll b[N];
vector<ll> vc;
int main()
{
    int n,k; ll s,t; scanf("%d%d%lld%lld",&n,&k,&s,&t);
    for(int i=0;i<n;i++){
        ll c,v; scanf("%lld%lld",&c,&v);
        a[i]={c,v};
    }
    for(int i=1;i<=k;i++)
        scanf("%lld",b+i);
    b[k+1]=s;
    sort(b+1,b+k+1);
    ll accels=max(s+s-t,0LL);
    if(accels>s){
        printf("-1"); return 0;
    }
    for(int i=0;i<=k;i++){
        vc.push_back(b[i+1]-b[i]);
    }
    sort(vc.begin(),vc.end());
    ll p=vc.back(),q=s+1;
    while(p<=q){
        ll mid=(p+q)/2,boosts=0; bool valid=true;
        for(ll x:vc){
            boosts+=min(mid-x,x);
        }
        //printf("%lld: %lld %lld\n",mid,boosts,accels);
        if(boosts<accels) p=mid+1;
        else q=mid-1;
    }
    ll fuels=p;
    if(q>=s+1){
        printf("-1"); return 0;
    }
    ll ans=(1LL<<62);
    for(int i=0;i<n;i++){
        if(a[i].v>=fuels) ans=min(ans,a[i].c);
    }
    if(ans==(1LL<<62)) printf("-1");
    else printf("%lld",ans);
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <math.h>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;

typedef long long LL;

#define X first
#define Y second

vector<LL> ps;

const LL INF = 2000000000 + 7;

LL solve(const vector<LL> &a, LL v) {
    int L = 0, R = a.size() - 1;
    if(v < a[a.size()-1])
        return INF;
    while(L+1<R) {
        int m = (L+R) / 2;
        if(a[m] * 2ll <= v) {
            L = m;
        }
        else
            R = m;
    }
    while(L < a.size() && a[L] * 2ll <= v)
        L ++;
    L --;

    LL len = ps[a.size() - 1] - (L >= 0 ? ps[L] : 0);
    LL k = a.size() - (L + 1);

    LL res = (L >= 0 ? ps[L] : 0) + (k * v - len + (2ll* len - v * k) * 2ll);

    return res;
}

int main() {
    LL n, k, s, t;
    cin >> n >> k >> s >> t;
    vector< pair<LL, LL> > cars(n);
    vector<LL> g(k);
    for(int i=0;i<n;i++) {
        cin >> cars[i].Y >> cars[i].X;
    }
    for(int i=0;i<k;i++)
        cin >> g[i];

    g.push_back(0);
    g.push_back(s);
    sort(g.begin(), g.end());

    vector<LL> a(k + 1);

    for(int i=0;i<g.size()-1;i++)
        a[i] = g[i+1] - g[i];
    sort(a.begin(), a.end());
    ps.resize(k+1);

    for(int i=0;i<a.size();i++) {
        ps[i] = (i ? ps[i-1] : 0) + a[i];
    }

    LL L = 0, R = INF;
    while(L + 1 < R) {
        LL m = (L+R) / 2;
        if(solve(a, m) <= t)
            R = m;
        else
            L = m;
    }
    while(R > 0 && solve(a, R) > t) R--;

    LL ans = INF;
    for(int i=0;i<cars.size();i++) {
        if(cars[i].X >= R)
            ans = min(ans, cars[i].Y);
    }
    if(ans == INF)
        ans = -1;
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <math.h>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <cstdio>
using namespace std;

typedef long long LL;

#define X first
#define Y second

vector<LL> ps;

const LL INF = 2000000000 + 7;

LL solve(const vector<LL> &a, LL v) {
    int L = 0, R = a.size() - 1;
    if(v < a[a.size()-1])
        return INF;
    while(L+1<R) {
        //cout << "\t\t" << L << " " << R << endl;
        int m = (L+R) / 2;
        if(a[m] * 2ll <= v) {
            L = m;
        }
        else
            R = m;
    }
    while(L < a.size() && a[L] * 2ll <= v)
        L ++;
    L --;

    LL len = ps[a.size() - 1] - (L >= 0 ? ps[L] : 0);
    LL k = a.size() - (L + 1);

    LL res = (L >= 0 ? ps[L] : 0) + (k * v - len + (2ll* len - v * k) * 2ll);

    return res;
}

int main() {
    LL n, k, s, t;
    cin >> n >> k >> s >> t;
    vector< pair<LL, LL> > cars(n);
    vector<LL> g(k);
    for(int i=0;i<n;i++) {
        //cin >> cars[i].Y >> cars[i].X;
        scanf("%d%d", &cars[i].Y, &cars[i].X);
    }
    for(int i=0;i<k;i++) {
        //cin >> g[i];
        scanf("%d", &g[i]);
    }

    g.push_back(0);
    g.push_back(s);
    sort(g.begin(), g.end());

    vector<LL> a(k + 1);

    for(int i=0;i<g.size()-1;i++)
        a[i] = g[i+1] - g[i];
    sort(a.begin(), a.end());
    ps.resize(k+1);

    for(int i=0;i<a.size();i++) {
        ps[i] = (i ? ps[i-1] : 0) + a[i];
    }

    LL L = 0, R = INF;
    while(L + 1 < R) {
        //cout << L << " " << R << endl;
        LL m = (L+R) / 2;
        if(solve(a, m) <= t)
            R = m;
        else
            L = m;
    }
    if(R == INF)
        {
            cout << -1 << endl;
            return 0;
        }
    while(R > 0 && solve(a, R) > t) R--;

    LL ans = INF;
    for(int i=0;i<cars.size();i++) {
        if(cars[i].X >= R)
            ans = min(ans, cars[i].Y);
    }
    if(ans == INF)
        ans = -1;
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <math.h>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;

typedef long long LL;

#define X first
#define Y second

vector<LL> ps;

const LL INF = 1000000000 + 7;

LL solve(const vector<LL> &a, LL v) {
    int L = 0, R = a.size() - 1;
    if(v < a[a.size()-1])
        return INF;
    while(L+1<R) {
        int m = (L+R) / 2;
        if(a[m] * 2ll <= v) {
            L = m;
        }
        else
            R = m-1;
    }
    while(L < a.size() && a[L] * 2ll <= v)
        L ++;
    L --;

    LL len = ps[a.size() - 1] - (L >= 0 ? ps[L] : 0);
    LL k = a.size() - (L + 1);

    LL res = (L >= 0 ? ps[L] : 0) + (k * v - len + (2ll* len - v * k) * 2ll);

    return res;
}

int main() {
    LL n, k, s, t;
    cin >> n >> k >> s >> t;
    vector< pair<LL, LL> > cars(n);
    vector<LL> g(k);
    for(int i=0;i<n;i++) {
        cin >> cars[i].Y >> cars[i].X;
    }
    for(int i=0;i<k;i++)
        cin >> g[i];

    g.push_back(0);
    g.push_back(s);
    sort(g.begin(), g.end());

    vector<LL> a(k + 1);

    for(int i=0;i<g.size()-1;i++)
        a[i] = g[i+1] - g[i];
    sort(a.begin(), a.end());
    ps.resize(k+1);

    for(int i=0;i<a.size();i++) {
        ps[i] = (i ? ps[i-1] : 0) + a[i];
    }

    int L = 0, R = INF;
    while(L + 1 < R) {
        int m = (L+R) / 2;
        if(solve(a, m) <= t)
            R = m;
        else
            L = m;
    }
    while(R > 0 && solve(a, R) > t) R--;

    LL ans = INF;
    for(int i=0;i<cars.size();i++) {
        if(cars[i].X >= R)
            ans = min(ans, cars[i].Y);
    }
    if(ans == INF)
        ans = -1;
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <math.h>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;

typedef long long LL;

#define X first
#define Y second

vector<LL> ps;

const LL INF = 2000000000 + 7;

LL solve(const vector<LL> &a, LL v) {
    int L = 0, R = a.size() - 1;
    if(v < a[a.size()-1])
        return INF;
    while(L+1<R) {
        int m = (L+R) / 2;
        if(a[m] * 2ll <= v) {
            L = m;
        }
        else
            R = m-1;
    }
    while(L < a.size() && a[L] * 2ll <= v)
        L ++;
    L --;

    LL len = ps[a.size() - 1] - (L >= 0 ? ps[L] : 0);
    LL k = a.size() - (L + 1);

    LL res = (L >= 0 ? ps[L] : 0) + (k * v - len + (2ll* len - v * k) * 2ll);

    return res;
}

int main() {
    LL n, k, s, t;
    cin >> n >> k >> s >> t;
    vector< pair<LL, LL> > cars(n);
    vector<LL> g(k);
    for(int i=0;i<n;i++) {
        cin >> cars[i].Y >> cars[i].X;
    }
    for(int i=0;i<k;i++)
        cin >> g[i];

    g.push_back(0);
    g.push_back(s);
    sort(g.begin(), g.end());

    vector<LL> a(k + 1);

    for(int i=0;i<g.size()-1;i++)
        a[i] = g[i+1] - g[i];
    sort(a.begin(), a.end());
    ps.resize(k+1);

    for(int i=0;i<a.size();i++) {
        ps[i] = (i ? ps[i-1] : 0) + a[i];
    }

    LL L = 0, R = INF;
    while(L + 1 < R) {
        LL m = (L+R) / 2;
        if(solve(a, m) <= t)
            R = m;
        else
            L = m;
    }
    while(R > 0 && solve(a, R) > t) R--;

    LL ans = INF;
    for(int i=0;i<cars.size();i++) {
        if(cars[i].X >= R)
            ans = min(ans, cars[i].Y);
    }
    if(ans == INF)
        ans = -1;
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <math.h>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;

typedef long long LL;

#define X first
#define Y second

int main() {
    LL n, k, s, t;
    cin >> n >> k >> s >> t;
    vector< pair<LL, LL> > cars(n);
    vector<LL> g(k);
    for(int i=0;i<n;i++) {
        cin >> cars[i].Y >> cars[i].X;
    }
    for(int i=0;i<k;i++)
        cin >> g[i];

    g.push_back(0);
    g.push_back(s);
    sort(g.begin(), g.end());

    sort(cars.begin(), cars.end());

    vector<LL> a(k + 1);

    for(int i=0;i<g.size()-1;i++)
        a[i] = g[i+1] - g[i];
    sort(a.begin(), a.end());
    vector<LL> ps(k+1);

    for(int i=0;i<a.size();i++) {
        ps[i] = (i ? ps[i-1] : 0) + a[i];
    }

    for(int i=0;i<cars.size();i++) {
        LL v = cars[i].X;

        if(v < a[a.size() - 1]) {
            continue;
        }
        int L = 0, R = a.size() - 1;
        while(L+1<R) {
            int m = (L+R) / 2;
            if(a[m] * 2ll <= v) {
                L = m;
            }
            else
                R = m-1;
        }
        while(L < a.size() && a[L] * 2ll <= v)
            L ++;
        L --;
        LL res = 0;

        res = L >= 0 ? ps[L] : 0;
        LL len = ps[a.size() - 1] - (L >= 0 ? ps[L] : 0);
        LL k = a.size() - (L + 1);
        res += k * v - len + (2ll* len - v * k) * 2ll;

        if(res <= t) {
            LL ans = 1000000000 + 7;
            for(int j=i;j<cars.size();j++) {
                ans = min(ans, cars[j].Y);
            }
            cout << ans << endl;
            return 0;
        }
    }

    cout << -1 << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <math.h>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;

typedef long long LL;

#define X first
#define Y second

vector<LL> ps;

const LL INF = 2000000000 + 7;

LL solve(const vector<LL> &a, LL v) {
    int L = 0, R = a.size() - 1;
    if(v < a[a.size()-1])
        return INF;
    while(L+1<R) {
        int m = (L+R) / 2;
        if(a[m] * 2ll <= v) {
            L = m;
        }
        else
            R = m-1;
    }
    while(L < a.size() && a[L] * 2ll <= v)
        L ++;
    L --;

    LL len = ps[a.size() - 1] - (L >= 0 ? ps[L] : 0);
    LL k = a.size() - (L + 1);

    LL res = (L >= 0 ? ps[L] : 0) + (k * v - len + (2ll* len - v * k) * 2ll);

    return res;
}

int main() {
    LL n, k, s, t;
    cin >> n >> k >> s >> t;
    vector< pair<LL, LL> > cars(n);
    vector<LL> g(k);
    for(int i=0;i<n;i++) {
        cin >> cars[i].Y >> cars[i].X;
    }
    for(int i=0;i<k;i++)
        cin >> g[i];

    g.push_back(0);
    g.push_back(s);
    sort(g.begin(), g.end());

    vector<LL> a(k + 1);

    for(int i=0;i<g.size()-1;i++)
        a[i] = g[i+1] - g[i];
    sort(a.begin(), a.end());
    ps.resize(k+1);

    for(int i=0;i<a.size();i++) {
        ps[i] = (i ? ps[i-1] : 0) + a[i];
    }

    int L = 0, R = INF;
    while(L + 1 < R) {
        int m = (L+R) / 2;
        if(solve(a, m) <= t)
            R = m;
        else
            L = m;
    }
    while(R > 0 && solve(a, R) > t) R--;

    LL ans = INF;
    for(int i=0;i<cars.size();i++) {
        if(cars[i].X >= R)
            ans = min(ans, cars[i].Y);
    }
    if(ans == INF)
        ans = -1;
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <math.h>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;

typedef long long LL;

#define X first
#define Y second

vector<LL> ps;

const LL INF = 2000000000 + 7;

LL solve(const vector<LL> &a, LL v) {
    int L = 0, R = a.size() - 1;
    if(v < a[a.size()-1])
        return INF;
    while(L+1<R) {
        int m = (L+R) / 2;
        if(a[m] * 2ll <= v) {
            L = m;
        }
        else
            R = m;
    }
    while(L < a.size() && a[L] * 2ll <= v)
        L ++;
    L --;

    LL len = ps[a.size() - 1] - (L >= 0 ? ps[L] : 0);
    LL k = a.size() - (L + 1);

    LL res = (L >= 0 ? ps[L] : 0) + (k * v - len + (2ll* len - v * k) * 2ll);

    return res;
}

int main() {
    LL n, k, s, t;
    cin >> n >> k >> s >> t;
    vector< pair<LL, LL> > cars(n);
    vector<LL> g(k);
    for(int i=0;i<n;i++) {
        //cin >> cars[i].Y >> cars[i].X;
        scanf("%d%d", &cars[i].Y, &cars[i].X);
    }
    for(int i=0;i<k;i++) {
        //cin >> g[i];
        scanf("%d", &g[i]);
    }

    g.push_back(0);
    g.push_back(s);
    sort(g.begin(), g.end());

    vector<LL> a(k + 1);

    for(int i=0;i<g.size()-1;i++)
        a[i] = g[i+1] - g[i];
    sort(a.begin(), a.end());
    ps.resize(k+1);

    for(int i=0;i<a.size();i++) {
        ps[i] = (i ? ps[i-1] : 0) + a[i];
    }

    LL L = 0, R = INF;
    while(L + 1 < R) {
        LL m = (L+R) / 2;
        if(solve(a, m) <= t)
            R = m;
        else
            L = m;
    }
    while(R > 0 && solve(a, R) > t) R--;

    LL ans = INF;
    for(int i=0;i<cars.size();i++) {
        if(cars[i].X >= R)
            ans = min(ans, cars[i].Y);
    }
    if(ans == INF)
        ans = -1;
    cout << ans << endl;
    return 0;
}


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

const int maxn = 2e5 + 9;
const long long mod = 1e9 + 7;

int n, k, nb = 0;
long long s, t;
long long cur, mx, sum, pre, res = -1;
long long c[maxn], v[maxn], g[maxn];
map<long long, long long> num, pree;
set<long long> st;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin >> n >> k >> s >> t;
	for (int i = 0; i < n; i++) {
		cin >> c[i] >> v[i];
	}
	for (int i = 0; i < k; i++) {
		cin >> g[i];
	}
	sort(g, g + k);
	for (int i = 0; i < k; i++) {
		num[g[i] - pre]++;
		st.insert(g[i] - pre);
		mx = max(mx, g[i] - pre);
		pre = g[i];
	}
	st.insert(s - pre);
	num[s - pre]++;
	mx = max(mx, s - pre);
	for (int i = 0; i < n; i++) {
		st.insert(v[i] / 2);
	}
	for (auto x : st) {
		nb += num[x];
		cur += num[x] * x;
		pree[x] = cur;
		num[x] = nb;
	}
	for (int i = 0; i < n; i++) {
		if (v[i] < mx) {
			continue;
		}
		long long f = num[v[i] / 2];
		long long ff = pree[v[i] / 2];
		long long cur = v[i] * (k + 1 - f) - (s - ff);
		if (ff + cur + (s - ff - cur) * 2 <= t) {
			res = ((res + 1) ? min(res, c[i]) : c[i]);
		}
	}
	cout << res << '\n';
	return 0;
}


//
//  main.cpp
//  737A
//
//  Created by zya on 17/1/17.
//  Copyright © 2017年 zya. All rights reserved.
//

#include <iostream>
#include <algorithm>
using namespace std;
long long f[222222], n, k, s, t, tmp;
struct _car{
    long long c,v;
}car[222222];

bool cper(const _car &a,const _car &b){return a.v<b.v;}

long long check(long long fuel){
    long long ans=0;
    for (long long i=1; i<=k; i++){
        if (fuel<f[i]) {
            return false;
        }
        if(fuel>=f[i] && fuel<2*f[i]){
            ans+=3*f[i]-fuel;
        }
        else{
            ans+=f[i];
        }
    }
    return ans<=t;
}

int main(void) {
    cin>>n>>k>>s>>t;
    long long l=0,r=n-1;
    for (long long i=0; i<n; i++) {
        cin>>car[i].c>>car[i].v;
//        if (car[i].v>r) {
//            r=car[i].v;
//        }
//        if (car[i].v<l) {
//            l=car[i].v;
//        }
    }
    for (long long i=1; i<=k; i++) {
        cin>>f[i];
    }
    k++;
    sort(f, f+k);
    sort(car, car+n, cper);
    f[k]=s;
    s=0;
    for (long long i=k; i>=1; i--) {
        f[i]-=f[i-1];
//        if (s<f[i]) {
//            s=f[i];
//        }
    }
    //if(s>l)l=s;
    long long mid=(l+r)>>1,ans=-1;
    if (!check(car[r].v)||l>r) {
        cout<<-1<<endl;
    }
    else{
        ans=r;
        r--;
        while (l<=r) {
            if (check(car[mid].v)) {
                ans=mid;
                r=mid-1;
            }
            else{
                l=mid+1;
            }
            mid=(l+r)>>1;
        }
        long long cmin=2100060000;
        for (long long i=ans; i<n; i++) {
            if (car[i].c<cmin) {
                cmin=car[i].c;
            }
        }
        cout<<cmin<<endl;
    }
    return 0;
}
//using namespace std;
//const long long N=2e5+20;
//typedef long long ll;
//ll s,T;//
//long long n,k;
//long long p[N];//the pos of gas station
//struct node{
//    ll c;
//    ll v;
//}a[N];
//bool cmp(node &x,node &y)// 按tank容量小到大排序
//{
//    return x.v<y.v;
//}
//bool check(long long x)
//{
//    long long cnt=0,pre=p[0];
//    for(long long i=1;i<=k+1;i++)
//    {
//        long long d=p[i]-pre;
//        if(d>a[x].v)
//            return false;//无法到达下一个gas station
//
//        //加油不要钱 不需要时间 到达一次肯定充满一次
//        long long t=a[x].v/2;
//        if(d<=t)//有油 就加速
//            cnt+=d;
//        else
//        {
//            //为了最快,y为使用加速的时间,应该要最大
//            //2y+(d-y)<=v
//            long long y=a[x].v-d;
//            cnt+=y+(d-y)*2;
//        }
//        pre=p[i];
//        if(cnt>T)
//            return false;
//    }
//    return true;
//}
//long long main()
//{
//    cin>>n>>k>>s>>T;
//    for(long long i=1;i<=n;i++)
//        scanf("%I64d%I64d",&a[i].c,&a[i].v);
//
//    for(long long i=1;i<=k;i++)
//        scanf("%d",&p[i]);
//
//    p[0]=0;
//    p[k+1]=s;//起点终点方便起见也看作油站
//    sort(p,p+k+2);
//    sort(a+1,a+1+n,cmp);
//
//    long long l=1,r=n;
//    long long j=0;
//    //vi>vj 若使用vj能通过 vi也能通过 二分找到最小的vj 然后再j~n中选出c最小的即可
//    while(l<=r)
//    {
//        long long mid=(l+r)/2;
//        if(check(mid))
//        {
//            j=mid;
//            r=mid-1;
//        }
//        else
//        {
//            l=mid+1;
//        }
//    }
//    if(!j)
//        cout<<-1<<endl;
//    else
//    {
//        ll ans=1e9;
//
//        for(;j<=n;j++)
//        {
//
//            ans=min(a[j].c,ans);
//        }
//        cout<<ans<<endl;
//    }
//    return 0;
//}