#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <set>
#include <queue>
#include <map>
#include <iomanip>
#include <cstring>
#include <cmath>

using namespace std;
const long double eps = 1e-12;

typedef long long ll;
typedef pair<int , int> pt;

#define sz(a) ((int) a.size() )
#define LL(x) (x << 1)
#define RR(x) ((x << 1) | 1)
#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 Rep(i , n) for (int i = 0 ; i < n ; i++)

const int maxn = 200000 + 1912;
int n , m , K , Q;

struct edge{
    int u , v , w;
};
vector<edge> V[maxn];
vector<pt> e;
bool fes[maxn];

void ReadData() {
    cin >> n >> m >> K >> Q;
    For(i , 1 , m) {
        int u , v , w; cin >> u >> v >> w;
        V[u].push_back((edge){u , v , w});
        V[v].push_back((edge){v , u , w});
        e.push_back(make_pair(u , v));
    }
    For(i , 1 , K) {
        int x; cin >> x; fes[x] = true;
    }
}

const long long INF = 1000LL * 1000 * 1000 * 1000 * 1000 * 1000 + 1912;
long long d[maxn];
priority_queue<pair<long long , int> > qu;
void Dijkstra() {
    For(i , 1 , n) d[i] = INF;
    For(i , 1 , n) if (fes[i]) {
        d[i] = 0; qu.push(make_pair(0 , i));
    }

    while (sz(qu)) {
        pair<long long , int> tt = qu.top(); qu.pop();
        long long cur = -tt.first; int u = tt.second;
        if (d[u] != cur) continue;
        Rep(i , sz(V[u])) {
            int v = V[u][i].v , w = V[u][i].w;
            if (d[v] > d[u] + w) {
                d[v] = d[u] + w;
                qu.push(make_pair(-d[v] , v));
            }
        }
    }
}

//--------------------------------------------------------------------------
int lab[maxn];

int fin(int u) {
    return lab[u] <= 0 ? u : lab[u] = fin(lab[u]);
}

void Join(int a , int b) {
    if (lab[a] < lab[b]) lab[b] = a; else {
        if (lab[a] == lab[b]) lab[b]--; lab[b] = a;
    }
}

bool ProcessEdge(int a , int b) {
    a = fin(a) , b = fin(b);
    if (a != b) {
        Join(a , b); return true;
    } return false;
}
//--------------------------------------------------------------------------

bool cmp(pt a ,  pt b) {
    return min(d[a.first] , d[a.second]) < min(d[b.first] , d[b.second]);
}
const int lg = 17;
vector<pair<int , long long> > E[maxn];
int level[maxn] , papa[maxn][lg + 2];
long long dp[maxn][lg + 2];

inline void dfs(const int u , const int prev){
    Rep(i , sz(E[u])) {
        int v = E[u][i].first; if (v == prev) continue;
        long long w = E[u][i].second;
        papa[v][0] = u;
        dp[v][0] = w;
        level[v] = level[u] + 1;
        dfs(v , u);
    }
}

long long Query(int p , int q) {
    long long res = INF;
    if (level[p] > level[q]) swap(p , q);
    int diff = level[q] - level[p];
    Rep(i , lg + 1) if ((diff >> i) & 1) {
        res = min(res , dp[q][i]); q = papa[q][i];
    }
    if (p != q) {
        Ford(i , lg , 0) if (papa[q][i] != papa[p][i]) {
            res = min(res , min(dp[p][i] , dp[q][i]));
            q = papa[q][i] , p = papa[p][i];
        }
        res = min(res , min(dp[p][0] , dp[q][0]));
    }
    return res;
}


void Process() {
    Dijkstra();
    sort(e.begin() , e.end() , cmp);
    Ford(i , sz(e) - 1 , 0) {
        int u = e[i].first , v = e[i].second;
        if (ProcessEdge(u , v)) {
            E[u].push_back(make_pair(v , min(d[u] , d[v])));
            E[v].push_back(make_pair(u , min(d[u] , d[v])));
        }
    }

    dfs(1 , 0);
    For(i , 1 , lg)For(u , 1 , n) papa[u][i] = papa[papa[u][i - 1]][i - 1];
    For(i , 1 , lg)For(u , 1 , n) dp[u][i] = min(dp[u][i - 1] , dp[papa[u][i - 1]][i - 1]);

    while (Q--) {
        int s , t;
        cin >> s >> t; cout << Query(s , t) << "\n";
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   // freopen("/users/youaremysky/documents/workspace/input.inp" , "r" , stdin);
    ReadData();
    Process();
}

Measured memory_bytes: 57472