#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }




const int INF = 1LL<<29;
const int MAX_V = 100100;
const int MAX_DEPTH = 21;
struct Graph {
    int V;
    vector<int> list[MAX_V];
    
    Graph(int n = 0) : V(n) {}
    void init(int n = 0) {V = n; for (int i = 0; i < MAX_V; ++i) list[i].clear();}
    inline const vector<int>& operator [] (int i) const {return list[i];}
    
    void connect(int f, int t) {
        list[f].push_back(t);
        list[t].push_back(f);
    }
    
    friend ostream& operator << (ostream& s, const Graph& G) {
        s << endl; for (int i = 0; i < G.V; ++i) {s << i << " : " << G.list[i] << endl;}return s;
    }
};

struct LCA {
    int root;
    int parent[MAX_V][MAX_DEPTH];
    int depth[MAX_V];
    
    void init(const Graph &G, int r) {
        memset(parent, -1, sizeof(parent));
        root = r;
        dfs(G, r, -1, 0);
        for (int i = 0; i < MAX_DEPTH-1; ++i) 
            for (int v = 0; v < G.V; ++v) 
                if (parent[v][i] >= 0) 
                    parent[v][i+1] = parent[parent[v][i]][i];
    }
    
    void dfs(const Graph &G, int v, int p, int d) {
        parent[v][0] = p;
        depth[v] = d;
        for (int i = 0; i < G[v].size(); ++i)
            if (G[v][i] != p)
                dfs(G, G[v][i], v, d+1);
    }
    
    int get(int u, int v) {
        if (depth[u] > depth[v]) swap(u, v);
        for (int i = 0; i < MAX_DEPTH; ++i) 
            if ( ((depth[v] - depth[u]) >> i) & 1 ) 
                v = parent[v][i];
        if (u == v) return u;
        for (int i = MAX_DEPTH-1; i >= 0; --i) {
            if (parent[u][i] != parent[v][i]) {
                u = parent[u][i];
                v = parent[v][i];
            }
        }
        return parent[u][0];
    }
} lca;

struct UnionFind {    
    int size_;
    int par[MAX_V];
    int rank[MAX_V];
    
    UnionFind(int n = 0) {size_ = n; for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0;}
    void init(int n) {size_ = n; for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0;}
    int root(int x) {return par[x] == x ? x : par[x] = root(par[x]);}    
    bool same(int x, int y) {return root(x) == root(y);}
    friend ostream& operator << (ostream& s, UnionFind uf) {return s << uf.group();}
    
    void connect(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return;        
        if (rank[x] < rank[y]) par[x] = y;
        else {par[y] = x; if (rank[x] == rank[y]) ++rank[x];}
    }
    
    void direct(int c, int p) {
        c = root(c); p = root(p);
        if (c == p) return;
        par[c] = p;
    }
    
    vector<vector<int> > group() {
        vector<vector<int> > res;        
        vector<bool> fixed(size_, false);
        for (int i = 0; i < size_; ++i) {
            if (!fixed[i]) {
                vector<int> temp;
                for (int j = i; j < size_; ++j) {
                    if (same(i, j)) temp.push_back(j), fixed[j] = true;
                }
                res.push_back(temp);
            }
        }
        return res;
    }
} uf;


int N, M, K, Q, s, t;
vector<pint> OG[MAX_V];
int dist[MAX_V];


int main() {
    //freopen( "/Users/macuser/Dropbox/Contest/input.in", "r", stdin );
    
    while (cin >> N >> M >> K >> Q) {
        for (int i = 0; i < MAX_V; ++i) OG[i].clear();
        for (int i = 0; i < M; ++i) {
            int a, b, l;
            cin >> a >> b >> l; --a; --b;
            OG[a].PB( pint(b,l) );
            OG[b].PB( pint(a,l) );
        }
        for (int i = 0; i < MAX_V; ++i) dist[i] = INF;
        priority_queue< pair<int,int>, vector<pair<int,int> >, greater<pair<int,int> > > que;
        for (int i = 0; i < K; ++i) {
            int v; cin >> v; --v;
            dist[v] = 0;
            que.push( MP(0,v) );
        }
        while (!que.empty()) {
            int dis = que.top().first;
            int v = que.top().second;
            que.pop();
            if (dist[v] < dis) continue;
            for (int i = 0; i < OG[v].size(); ++i) {
                int to = OG[v][i].first;
                int len = OG[v][i].second;
                if (chmin(dist[to], dis + len)) {
                    que.push( MP(dis+len, to) );
                }
            }
        }
        
        uf.init(N);
        vector< pair<int,int> > nodes(N);
        for (int i = 0; i < N; ++i) nodes[i] = MP(dist[i], i);
        sort(ALL(nodes), greater< pair<int,int> >());
        
        //COUT(nodes);
        
        Graph G;
        G.init(N);
        for (int i = 0; i < nodes.size(); ++i) {
            int v = nodes[i].second;
            for (int j = 0; j < OG[v].size(); ++j) {
                int c = OG[v][j].first;
                if (uf.same(v, c)) continue;
                if (dist[c] < dist[v]) continue;
                int r = uf.root(c);
                
                //cout << endl; COUT(v);COUT(c); COUT(r);
                
                G.connect(r, v);
                uf.direct(r, v);
            }
        }
        int root = nodes[N-1].second;
                
//        COUT(G);
//        COUT(root);
        
        lca.init(G, root);
        for (int i = 0; i < Q; ++i) {
            cin >> s >> t; --s; --t;
            int p = lca.get(s, t);
            
            //COUT(p);
            
            cout << dist[p] << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 27248