#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <queue>
#include <vector>
#include <stack>

using namespace std;

#define INF 1000000000

int n, m, k, q;

vector<pair<int,int> > tosi[100000];

int matu[100000];

int kyo[100000];

void dycs() {
	priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > pq;
	for (int i = 0; i < n; i++) {
		kyo[i] = INF;
	}
	for (int i = 0; i < k; i++) {
		pq.push(make_pair(0, matu[i]));
		kyo[matu[i]] = 0;
	}
	while (!pq.empty()) {
		auto w = pq.top();
		pq.pop();
		for (auto i : tosi[w.second]) {
			if (kyo[i.first] > w.first + i.second) {
				kyo[i.first] = w.first + i.second;
				pq.push(make_pair(w.first + i.second, i.first));
			}
		}
	}
}

class unionfind {
public:
	class pp {
	public:
		int r;
		int o;
	};

	pp* d;

	void init(int n) {
		d = new pp[n];
		for (int i = 0; i < n; i++) {
			d[i].r = 0;
			d[i].o = i;
		}
	}

	int find(int n) {
		if (d[n].o == n) {
			return n;
		}
		d[n].o = find(d[n].o);
		return d[n].o;
	}

	void unit(int a, int b) {
		if (d[a].r < d[b].r) {
			d[a].o = b;
		}
		else if (d[a].r == d[b].r) {
			d[a].r++;
			d[b].o = a;
		}
		else {
			d[b].o = a;
		}
	}
};

vector<int> tosi2[100000];

pair<int, int> tmp[100000];

void zeniki() {
	for (int i = 0; i < n; i++) {
		tmp[i] = make_pair(kyo[i], i);
	}
	sort(tmp, tmp + n, greater <pair<int, int> >());
	unionfind uf;
	uf.init(n);
	for (int i = 0; i < n; i++) {
		vector<pair<int, int> > ww;
		for (auto j : tosi[tmp[i].second]) {
			if (kyo[j.first] >= tmp[i].first) {
				int a = uf.find(tmp[i].second);
				int b = uf.find(j.first);
				if (a != b) {
					uf.unit(a, b);
					tosi2[tmp[i].second].push_back(j.first);
					tosi2[j.first].push_back(tmp[i].second);
				}
			}
		}
	}
}

class rmq {
public:
	int n;
	int* d;

	void init(int nw, int* dd) {
		n = 1;
		while (n < nw) {
			n *= 2;
		}
		d = new int[n * 2];
		for (int i = 0; i < nw; i++) {
			d[n - 1 + i] = dd[i];
		}
		for (int i = nw; i < n; i++) {
			d[n - 1 + i] = INF;
		}
		for (int i = n - 2; i >= 0; i--) {
			d[i] = min(d[i * 2 + 1], d[i * 2 + 2]);
		}
	}

	int dfs(int p, int nb, int ne, int b, int e) {
		if (e <= nb || ne <= b) {
			return INF;
		}
		if (b <= nb && ne <= e) {
			return d[p];
		}
		return min(dfs(p * 2 + 1, nb, (nb + ne) / 2, b, e), dfs(p * 2 + 2, (nb + ne) / 2, ne, b, e));
	}

	int get(int b, int e) {
		return dfs(0, 0, n, b, e);
	}
};

class node {
public:
	rmq d;
	int dep;
	pair<int, int> o;
	vector<int> dd;
};

bool sude[100000];
int deep[100000];
vector<int> tosi3[100000];
node hv[100000];
pair<int, int> bb[100000];

void dfsw() {
	for (int i = 0; i < n; i++) {
		sude[i] = false;
	}
	queue<int> qu;
	stack<int> st;
	qu.push(0);
	while (!qu.empty()) {
		int w = qu.front();
		qu.pop();
		st.push(w);
		sude[w] = true;
		for (auto i : tosi2[w]) {
			if (!sude[i]) {
				tosi3[w].push_back(i);
				qu.push(i);
			}
		}
	}
	while (!st.empty()) {
		int w = st.top();
		st.pop();
		if (tosi3[w].empty()) {
			deep[w] = 1;
		}
		else {
			deep[w] = 0;
			for (auto i : tosi3[w]) {
				deep[w] += deep[i];
			}
		}
	}
}

void heavylight() {
	queue<pair<int, int> > now;
	now.push(make_pair(0, 0));
	hv[0].dep = 0;
	hv[0].o = make_pair(0, 0);
	int nk = 1;
	while (!now.empty()) {
		auto w = now.front();
		now.pop();
		bb[w.first] = make_pair(w.second, hv[w.second].dd.size());
		hv[w.second].dd.push_back(kyo[w.first]);
		if (tosi3[w.first].empty()) {
			auto& q = hv[w.second];
			q.d.init(q.dd.size(), q.dd.data());
		}
		else {
			pair<int, int> q = make_pair(-1, -1);
			for (auto i : tosi3[w.first]) {
				q = max(q, make_pair(deep[i], i));
			}
			for (auto i : tosi3[w.first]) {
				if (i == q.second) {
					now.push(make_pair(i, w.second));
				}
				else {
					hv[nk].dep = hv[w.second].dep + 1;
					hv[nk].o = make_pair(w.second, hv[w.second].dd.size() - 1);
					now.push(make_pair(i, nk++));
				}
			}
		}
	}
}

int ans(int a, int b) {
	pair<int, int> na = bb[a];
	pair<int, int> nb = bb[b];
	int now = INF;
	while (na.first != nb.first) {
		if (hv[na.first].dep > hv[nb.first].dep) {
			now = min(now, hv[na.first].d.get(0, na.second + 1));
			na = hv[na.first].o;
		}
		else {
			now = min(now, hv[nb.first].d.get(0, nb.second + 1));
			nb = hv[nb.first].o;
		}
	}
	return min(now, hv[na.first].d.get(min(na.second, nb.second), max(na.second, nb.second) + 1));
}

int main() {
	scanf("%d%d%d%d", &n, &m, &k, &q);
	for (int i = 0; i < m; i++) {
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);
		a--;
		b--;
		tosi[a].push_back(make_pair(b, c));
		tosi[b].push_back(make_pair(a, c));
	}
	for (int i = 0; i < k; i++) {
		int w;
		scanf("%d", &w);
		matu[i] = w - 1;
	}
	dycs();
	zeniki();
	dfsw();
	heavylight();
	for (int i = 0; i < q; i++) {
		int s, t;
		scanf("%d%d", &s, &t);
		printf("%d\n", ans(s - 1, t - 1));
	}
}

Measured memory_bytes: 32400