    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    #define F first
    #define S second
    #define pii pair<int, int>
    #define eb emplace_back
    #define all(v) v.begin(), v.end()
    #define rep(i, n) for (int i = 0; i < (n); ++i)
    #define rep3(i, l, n) for (int i = l; i < (n); ++i)
    #define sz(v) (int)v.size()
    #define inf (int)(1e9+7)
    #define abs(x) (x >= 0 ? x : -(x))
    #define ceil(a, b) a / b + !!(a % b)
    template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
    template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
    ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
    template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

    vector<int> safe;
    const ll INF = 1e18;
    const int mxm = 200005;
    ll dp[mxm][2];
    int a[mxm][2];

    ll trans(int i, int v, int j, int u) {
        // cout << i << " " << v << " " << j << " " << u << '\n';
        ll ret = INF;
        int it = (int)(lower_bound(all(safe), a[j][u]) - safe.begin());
        if (it < sz(safe)) {
            chmin(ret, abs(safe[it] - a[j][u]) + abs(safe[it] - a[i][v ^ 1]) + abs(a[i][v] - a[i][v ^ 1]));
            // cout << safe[it] << " " << a[j][u] << " " << a[i][v] << " " << a[i][v ^ 1] << '\n';
        }
        it = (int)(upper_bound(all(safe), a[j][u]) - safe.begin() - 1);
        if (it >= 0) {
            chmin(ret, abs(a[j][u] - safe[it]) + abs(safe[it] - a[i][v ^ 1]) + abs(a[i][v] - a[i][v ^ 1]));
        }
        // cout << ret << '\n';
        return ret;
    }

    int main() {
        int n, m, k, q; cin >> n >> m >> k >> q;

        fill_n(*dp, mxm * 2, INF);
        rep(i, n) { a[i][0] = inf; a[i][1] = -inf; }
        rep(i, k) { int x, y; cin >> x >> y; x--; y--; chmin(a[x][0], y); chmax(a[x][1], y); }

        safe.resize(q);
        rep(i, q) { cin >> safe[i]; safe[i]--; }
        sort(all(safe));

        a[0][0] = 0; // start
        chmax(a[0][1], 0); // if there is no treasure
        dp[0][1] = a[0][1];
        dp[0][0] = a[0][1] + (a[0][1] - a[0][0]);
        // cout << '\n'; rep(i, n) { rep(j, 2) cout << dp[i][j] << " "; cout << '\n'; }

        int j = 0; // nearest row which has treasures
        rep3(i, 1, n) { // go to row i and move laterally
            if (a[i][0] == inf) continue;
            rep(v, 2) rep(u, 2) chmin(dp[i][v], dp[j][u] + trans(i, v, j, u) + i - j);
            j = i;
        }

        // cout << '\n'; rep(i, n) { rep(j, 2) cout << dp[i][j] << " "; cout << '\n'; }

        cout << min(dp[j][0], dp[j][1]) << '\n';

    }


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

int ans = inf;

vector<string> str;

void bfs(int i, int j, int n, int m) {
    if (i == 0) {
        while (str[i][j] == '#') {
            i++;
        }
        i++;
        while (str[i][j] == '#') {
            j--;
            if (j == -1) {
                ans = 1;
                return;
            }
        }
        while (str[i][j] == '#') {
            j++;
            if (j == m) {
                ans = 1;
                return;
            }
        }
    } else {
        while (str[i][j] == '#') {
            j++;
        }
        j++;
        while (str[i][j] == '#') {
            i--;
            if (i == -1) {
                ans = 1;
                return;
            }
        }
        while (str[i][j] == '#') {
            i++;
            if (i == n) {
                ans = 1;
                return;
            }
        }
    }
}

void bfs2(int i, int j, int n, int m) {
    int table[n][m];
    fill_n(*table, n * m, inf);

    queue<pii> q;
    q.push(pii(i,  j));
    table[i][j] = 0;

    int dy[] = {-1, 0, 1, 0};
    int dx[] = {0, 1, -1, 0};

    while (!q.empty()) {
        int y = q.front().F;
        int x = q.front().S;
        q.pop();

        rep(k, 4) {
            int ny = y + dy[k];
            int nx = x + dx[k];
            if (ny < 0 || ny >= n || nx < 0 || nx >= m) continue;
            if (table[ny][nx] >= table[y][x]) continue;

            if (table[ny][nx] == '#') {
                table[ny][nx] = table[y][x];
                if (i == n - 1 || j == 0) {
                    chmin(ans, 1);
                    return;
                }
                q.push(pii(ny, nx));
            } else {
                if (table[y][x] == 1) continue;
                table[ny][nx] = table[y][x] + 1;
                q.push(pii(ny, nx));
            }

        }
    }
}
int main() {

    int n, m;
    cin >> n >> m;

    str.resize(n);
    rep(i, n) cin >> str[i];

    if (n == 1) {
        // cout << str[0] << endl;
        rep(j, m) {
            // cout << str[0][j] << endl;
            if (str[0][j] == '#') {
                cout << 0 << '\n';
                return 0;
            }
        }
        cout << 1 << '\n';
        return 0;
    } else if (m == 1) {
        rep(i, n) {
            if (str[i][0] == '#') {
                cout << 0 << '\n';
                return 0;
            }
        }
        cout << 1 << '\n';
        return 0;
    }

    {
        int c = 0;
        if (str[0][1] == '#') c++;
        if (str[1][0] == '#') c++;
        chmin(ans, 2 - c);
    }

    {
        int c = 0;
        if (str[n - 1][m - 2] == '#') c++;
        if (str[n - 2][m - 1] == '#') c++;
        chmin(ans, 2 - c);
    }

    if (ans == 0) {
        cout << 0 << '\n';
        return 0;
    }

    rep(i, n) {
        int c = 0;
        rep(j, m) {
            if (str[i][j] == '#') c++;
        }
        if (c == m) {
            cout << 0 << '\n';
            return 0;
        }
    }

    rep(j, m) {
        int c = 0;
        rep(i, n) {
            if (str[i][j] == '#') c++;
        }
        if (c == n) {
            cout << 0 << '\n';
            return 0;
        }
    }

    rep(i, n) {
        if (str[i][0] == '#') bfs(i, 0, n, m);
    }
    rep(j, m) {
        if (str[0][j] == '#') bfs(0, j, n, m);
    }

    cout << ans << '\n';
}

/*
6 6
..#...
..#...
......
###...
......
......
*/

/*
3 3
.#.
.#.
.#.

1?!
*/

/*
3 3
.#.
#..
...

1?!
*/

// ぐにゃぐにゃに囲うケース


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

vector<int> safe;
int near_safe(int x) {
    int it = (int)(lower_bound(all(safe), x) - safe.begin());
    if (it == sz(safe)) return safe[it - 1];
    if (it == 0) return safe[it];
    return (safe[it] - x >= x - safe[it - 1] ? safe[it - 1] : safe[it]);
}

random_device rnd;
mt19937 mt(rnd());
uniform_int_distribution<> rand100(1, 199999);
#define rm rand100(mt);

int main() {
    // clock_t start, end;
    // start = clock();

    int n, m, k, q;
    cin >> n >> m >> k >> q;
    // n = 2e5, m = 2e5, k = 2e5, q = 2e5;

    int l[n], r[n];
    fill_n(l, n, inf);
    fill_n(r, n, -inf);

    rep(i, k) {
        int x, y;
        cin >> x >> y;
        // x = rm; y = rm;
        x--; y--;
        chmin(l[x], y);
        chmax(r[x], y);
    }

    safe.resize(q);
    rep(i, q) { cin >> safe[i]; /* safe[i] = rm; */ safe[i]--; }
    sort(all(safe));

    ll sum = 0;
    int nc = 0;

    for (int i = n - 1; i >= 0; --i) {
        if (l[i] == inf) {
            n = i;
        } else break;
    }

    rep(i, n - 1) {
        l[i] = (l[i] == inf ? nc : l[i]);
        r[i] = (r[i] == -inf ? nc : r[i]);

        int L = abs(nc - r[i]) + abs(r[i] - l[i]);
        int tmp = near_safe(l[i]);

        L += abs(l[i] - tmp) + 1 + (l[i + 1] != inf ? abs(l[i + 1] - tmp) : 0);

        int R = abs(nc - l[i]) + abs(r[i] - l[i]);
        int tmp2 = near_safe(r[i]);
        R += abs(r[i] - tmp2) + 1 + (r[i + 1] != -inf ? abs(r[i + 1] - tmp2) : 0);

        if (L < R) {
            sum += L;
            nc = (l[i + 1] != inf ? l[i + 1] : tmp);
        } else {
            sum += R;
            nc = r[i];
            nc = (r[i + 1] != -inf ? r[i + 1] : tmp2);
        }

    }

    if (nc - l[n - 1] <= r[n - 1] - nc) {
        sum += abs(nc - l[n - 1]);
        nc = l[n - 1];
        sum += abs(r[n - 1] - nc);
    } else {
        sum += abs(r[n - 1] - nc);
        nc = r[n - 1];
        sum += abs(nc - l[n - 1]);
    }

    cout << sum << '\n';
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

vector<ll> safe;
const ll INF = 1e18;
const int mxm = 200005;
ll dp[mxm][2];
ll a[mxm][2];

ll trans(int i, int v, int j, int u) {
    // cout << i << " " << v << " " << j << " " << u << '\n';
    ll ret = INF;
    int it = (int)(lower_bound(all(safe), a[j][u]) - safe.begin());
    if (it < sz(safe)) {
        chmin(ret, abs(safe[it] - a[j][u]) + abs(safe[it] - a[i][v ^ 1]) + abs(a[i][v] - a[i][v ^ 1]));
        // cout << safe[it] << " " << a[j][u] << " " << a[i][v] << " " << a[i][v ^ 1] << '\n';
    }
    it = (int)(upper_bound(all(safe), a[j][u]) - safe.begin() - 1);
    if (it >= 0) {
        chmin(ret, abs(a[j][u] - safe[it]) + abs(safe[it] - a[i][v ^ 1]) + abs(a[i][v] - a[i][v ^ 1]));
    }
    // cout << ret << '\n';
    return ret;
}

int main() {
    int n, m, k, q; cin >> n >> m >> k >> q;

    fill_n(*dp, mxm * 2, INF);
    rep(i, n) { a[i][0] = inf; a[i][1] = -inf; }
    rep(i, k) { int x, y; cin >> x >> y; x--; y--; chmin(a[x][0], y); chmax(a[x][1], y); }

    safe.resize(q);
    rep(i, q) { cin >> safe[i]; safe[i]--; }
    sort(all(safe));

    a[0][0] = 0; // start
    chmax(a[0][1], 0); // if there is no treasure
    dp[0][1] = a[0][1];
    dp[0][0] = a[0][1] + (a[0][1] - a[0][0]);
    // cout << '\n'; rep(i, n) { rep(j, 2) cout << dp[i][j] << " "; cout << '\n'; }

    int j = 0; // nearest row which has treasures
    rep3(i, 1, n) { // go to row i and move laterally
        if (a[i][0] == inf) continue;
        rep(v, 2) rep(u, 2) chmin(dp[i][v], dp[j][u] + trans(i, v, j, u) + i - j);
        j = i;
    }

    // cout << '\n'; rep(i, n) { rep(j, 2) cout << dp[i][j] << " "; cout << '\n'; }

    cout << min(dp[j][0], dp[j][1]) << '\n';

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

int near_safe(vector<int> safe, int x) {
    int it = (int)(lower_bound(all(safe), x) - safe.begin());
    if (it == sz(safe)) return safe[it - 1];
    if (it == 0) return safe[it];
    return (safe[it] - x >= x - safe[it - 1] ? safe[it - 1] : safe[it]);
}

int main() {
    int n, m, k, q;
    cin >> n >> m >> k >> q;

    int l[n], r[n];
    fill_n(l, n, inf);
    fill_n(r, n, -inf);

    rep(i, k) {
        int x, y;
        cin >> x >> y;
        x--; y--;
        chmin(l[x], y);
        chmax(r[x], y);
    }

    vector<int> safe(q);
    rep(i, q) { cin >> safe[i]; safe[i]--; }
    sort(all(safe));

    ll sum = 0;
    int nc = 0;

    for (int i = n - 1; i >= 0; --i) {
        if (l[i] == inf) {
            n = i - 1;
            break;
        }
    }

    rep(i, n - 1) {
        // 先に左回収した場合
        int L = abs(nc - r[i]) + abs(r[i] - l[i]);
        int tmp = near_safe(safe, l[i]);
        // cout << L << " " << tmp << '\n';
        L += abs(l[i] - tmp) + 1 + abs(l[i + 1] - tmp);

        int R = abs(nc - l[i]) + abs(r[i] - l[i]);
        tmp = near_safe(safe, r[i]);
        R += abs(r[i] - tmp) + 1 + abs(r[i + 1] - tmp);

        if (L < R) {
            sum += L;
            nc = l[i + 1];
        } else {
            sum += R;
            nc = r[i + 1];
        }

        // cout << nc << " " << L << " " << R << '\n';
    }

    if (nc - l[n - 1] <= r[n - 1] - nc) {
        sum += abs(nc - l[n - 1]);
        nc = l[n - 1];
        sum += abs(r[n - 1] - nc);
    } else {
        sum += abs(r[n - 1] - nc);
        nc = r[n - 1];
        sum += abs(nc - l[n - 1]);
    }

    cout << sum << '\n';
}

/*
// 横移動 and 上
if (r[i + 1] <= nc) {
    if (l[i] != r[i]) {
        sum += abs(r[i] - nc);
        nc = r[i];
        sum += abs(r[i] - nc);
        nc = l[i];
    } else {
        sum += abs(nc - l[i]);
        nc = l[i];
    }

    int it = (int)(upper_bound(all(safe), nc) - safe.begin());
    sum += abs(nc - safe[it - (it != 0)]);
    nc = safe[it - (it != 0)];
} else { // r[i + 1] > nc
    if (l[i] != r[i]) {
        sum += abs(l[i] - nc);
        nc = l[i];
        sum += abs(r[i] - nc);
        nc = r[i];
    } else {
        sum += abs(nc - r[i]);
        nc = r[i];
    }

    int it = (int)(lower_bound(all(safe), nc) - safe.begin());
    sum += abs(nc - safe[it - (it == sz(safe))]);
    nc = safe[it - (it == sz(safe))];
}
sum++;
cout << "nc " << nc << " " << sum << '\n';
*/


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e6+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

vector<int> safe;
int near_safe(int x, int key) {
    if (key == 0) { // it
        int it = (int)(lower_bound(all(safe), x) - safe.begin());
        return (it < sz(safe) ? safe[it] : inf);
    } else { // it - 1
        int it = (int)(upper_bound(all(safe), x) - safe.begin() - 1);
        return (it >= 0 ? safe[it] : inf);
    }
}

pii calc_divided_case(int L, int nc, int l, int l2, int tmp) {
    // now at l
    nc = tmp; // go to safe
    if (l2 == inf) {
        L += abs(l - tmp) + 1;
    } else {
        L += abs(l - tmp) + 1 + abs(l2 - tmp);
        nc = l2;
    }

    return pii(L, nc);
}

pii calc_i_to_i2_dist_and_pos(int nc, int l, int r, int l2, int r2) {
    int L = abs(nc - r) + abs(r - l); // go to the most right, and the most left
    // cout << "L " << L << '\n';
    nc = l;
    int tmp = near_safe(l, 0);
    int tmp2 = near_safe(l, 1);

    int L2 = L, nc2 = nc;

    rep(i, 4) {
        pii par = calc_divided_case(L2, nc2, l, (i < 2 ? l2 : r2), (i % 2 ? tmp2 : tmp));
        // cout << "par.F " << par.F << '\n';
        if (i == 0) { L = par.F; nc = par.S; }
        else if (par.F < L) {
            L = par.F;
            nc = par.S;
        }

    }

    return pii(L, nc);
}

int main() {
    int n, m, k, q; cin >> n >> m >> k >> q;
    int l[n], r[n]; fill_n(l, n, inf); fill_n(r, n, -inf);
    rep(i, k) { int x, y; cin >> x >> y; x--; y--; chmin(l[x], y); chmax(r[x], y); }

    safe.resize(q);
    rep(i, q) { cin >> safe[i]; safe[i]--; }
    sort(all(safe));

    ll sum = 0;
    int nc = 0;

    for (int i = n - 1; i >= 0; --i) {
        if (l[i] == inf) {
            n = i;
        } else break;
    }

    rep(i, n - 1) {
        // cout << i << '\n';
        if (l[i] == inf) {
            l[i] = r[i] = nc;
        }

        // 今いる場所から右端に行って左端から上がり, 右端か左端に行く
        pii L = calc_i_to_i2_dist_and_pos(nc, l[i], r[i], l[i + 1], r[i + 1]);
        pii R = calc_i_to_i2_dist_and_pos(nc, r[i], l[i], r[i + 1], l[i + 1]);

        if (L.F < R.F) {
            sum += L.F;
            nc = L.S;
        } else {
            sum += R.F;
            nc = R.S;
        }
        // cout << nc << " " << sum << '\n';
    }

    sum += min(abs(nc - l[n - 1]), abs(nc - r[n - 1])) + r[n - 1] - l[n - 1];
    cout << sum << '\n';
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

int near_safe(vector<int> safe, int x) {
    int it = (int)(lower_bound(all(safe), x) - safe.begin());
    if (it == sz(safe)) return safe[it - 1];
    if (it == 0) return safe[it];
    return (safe[it] - x >= x - safe[it - 1] ? safe[it - 1] : safe[it]);
}

int main() {
    int n, m, k, q;
    cin >> n >> m >> k >> q;

    int l[n], r[n];
    fill_n(l, n, inf);
    fill_n(r, n, -inf);

    rep(i, k) {
        int x, y;
        cin >> x >> y;
        x--; y--;
        chmin(l[x], y);
        chmax(r[x], y);
    }

    vector<int> safe(q);
    rep(i, q) { cin >> safe[i]; safe[i]--; }
    sort(all(safe));

    ll sum = 0;
    int nc = 0;

    for (int i = n - 1; i >= 0; --i) {
        if (l[i] == inf) {
            n = i;
        } else break;
    }
    // cout << n << '\n';

    rep(i, n - 1) {
        // 先に左回収した場合
        // cout << "nc " << nc << " " << l[i] << " " << r[i] << '\n';

        l[i] = (l[i] == inf ? nc : l[i]);
        r[i] = (r[i] == -inf ? nc : r[i]);

        int L = abs(nc - r[i]) + abs(r[i] - l[i]);
        int tmp = near_safe(safe, l[i]);
        // cout << L << " " << tmp << '\n';

        L += abs(l[i] - tmp) + 1 + (l[i + 1] != inf ? abs(l[i + 1] - tmp) : 0);

        int R = abs(nc - l[i]) + abs(r[i] - l[i]);
        tmp = near_safe(safe, r[i]);
        R += abs(r[i] - tmp) + 1 + (r[i + 1] != -inf ? abs(r[i + 1] - tmp) : 0);

        if (L < R) {
            sum += L;
            nc = l[i];
            nc = (l[i + 1] != inf ? l[i + 1] : nc);
        } else {
            sum += R;
            nc = r[i];
            nc = (r[i + 1] != -inf ? r[i + 1] : nc);
        }

        // cout << nc << " " << L << " " << R << '\n';
        // cout << nc << " " << sum << '\n';
    }
    // cout << sum << " " << nc << '\n';

    if (nc - l[n - 1] <= r[n - 1] - nc) {
        sum += abs(nc - l[n - 1]);
        nc = l[n - 1];
        sum += abs(r[n - 1] - nc);
    } else {
        sum += abs(r[n - 1] - nc);
        nc = r[n - 1];
        sum += abs(nc - l[n - 1]);
    }

    cout << sum << '\n';
}

/*
// 横移動 and 上
if (r[i + 1] <= nc) {
    if (l[i] != r[i]) {
        sum += abs(r[i] - nc);
        nc = r[i];
        sum += abs(r[i] - nc);
        nc = l[i];
    } else {
        sum += abs(nc - l[i]);
        nc = l[i];
    }

    int it = (int)(upper_bound(all(safe), nc) - safe.begin());
    sum += abs(nc - safe[it - (it != 0)]);
    nc = safe[it - (it != 0)];
} else { // r[i + 1] > nc
    if (l[i] != r[i]) {
        sum += abs(l[i] - nc);
        nc = l[i];
        sum += abs(r[i] - nc);
        nc = r[i];
    } else {
        sum += abs(nc - r[i]);
        nc = r[i];
    }

    int it = (int)(lower_bound(all(safe), nc) - safe.begin());
    sum += abs(nc - safe[it - (it == sz(safe))]);
    nc = safe[it - (it == sz(safe))];
}
sum++;
cout << "nc " << nc << " " << sum << '\n';
*/


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fs first
#define sc second

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int inf = 1e9 + 7;
const int maxn = 2e5 + 7;
int L[maxn], R[maxn];
int dpL[maxn],dpR[maxn];
int n, m, k ,q;
vector<int> safe;

int path_left(int pre_col, int nxt_col){
	int ans = 0;
	if (safe[0] > pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] <= pre_col){
			res = mid;
			lo = mid + 1;
		}else hi = mid - 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(nxt_col - safe[res]);
	return ans;
}

int path_right(int pre_col, int nxt_col){
	int ans = 0;
	if (safe.back() < pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] >= pre_col){
			res = mid;
			hi = mid - 1;
		}else lo = mid + 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(nxt_col - safe[res]);
	return ans;
}

int main(){
	ios :: sync_with_stdio(false); cin.tie(0);
	cin >> n >> m >> k >> q;
	for(int i = 1; i <= n; i++){
		L[i] = inf;
		R[i] = -inf;
	}
	L[1] = R[1] = 1;
	int x, y;
	for(int i = 1; i <= k; i++){
		cin >> x >> y;
		L[x] = min(L[x], y);
		R[x] = max(R[x], y);
	}

	for(int i = 1; i <= q; i++){
		cin >> x;
		safe.pb(x);
	}
	sort(safe.begin(), safe.end());
	dpL[1] = inf; dpR[1] = R[1] - L[1];
	for(int i = 2; i <= n; i++){
		dpL[i] = inf;
		dpL[i] = min(dpL[i], dpR[i - 1] + path_left(R[i - 1], L[i]));
		dpL[i] = min(dpL[i], dpR[i - 1] + path_right(R[i - 1], L[i]));
		dpR[i] = inf;
		dpR[i] = min(dpR[i], dpL[i - 1] + path_left(L[i - 1], R[i]));
		dpR[i] = min(dpR[i], dpL[i - 1] + path_right(L[i - 1], R[i]));
	}
	cout << min(dpL[n], dpR[n]) << endl;;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fs first
#define sc second

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int inf = 1e9 + 7;
const int maxn = 2e5 + 7;
int L[maxn], R[maxn];
int dpL[maxn],dpR[maxn];
int n, m, k ,q;
vector<int> safe;

int path_left(int pre_col, int nxt_col){
	int ans = 0;
	if (safe[0] > pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] <= pre_col){
			res = mid;
			lo = mid + 1;
		}else hi = mid - 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(nxt_col - safe[res]);
	return ans;
}

int path_right(int pre_col, int nxt_col){
	int ans = 0;
	if (safe.back() < pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] >= pre_col){
			res = mid;
			hi = mid - 1;
		}else lo = mid + 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(safe[res] - nxt_col);
	return ans;
}

int main(){
	ios :: sync_with_stdio(false); cin.tie(0);
	cin >> n >> m >> k >> q;
	for(int i = 1; i <= n; i++){
		L[i] = inf;
		R[i] = -inf;
	}
	L[1] = R[1] = 1;
	int x, y;
	for(int i = 1; i <= k; i++){
		cin >> x >> y;
		L[x] = min(L[x], y);
		R[x] = max(R[x], y);
	}

	for(int i = 1; i <= q; i++){
		cin >> x;
		safe.pb(x);
	}
	sort(safe.begin(), safe.end());
	dpL[1] = inf; dpR[1] = R[1] - L[1];
	while (R[n] < 0) n--;
	for(int i = 2; i <= n; i++){
		if (R[i] < 0){
			R[i] = R[i - 1];
			L[i] = L[i - 1];
			dpR[i] = dpR[i - 1] + 1;
			dpL[i] = dpL[i - 1] + 1;
			continue;
		}
		dpL[i] = inf;
		dpL[i] = min(dpL[i], dpR[i - 1] + path_left(R[i - 1], R[i]) + R[i] - L[i]);
		dpL[i] = min(dpL[i], dpR[i - 1] + path_right(R[i - 1], R[i]) + R[i] - L[i]);
		dpR[i] = inf;
		dpR[i] = min(dpR[i], dpL[i - 1] + path_left(L[i - 1], L[i]) + R[i] - L[i]);
		dpR[i] = min(dpR[i], dpL[i - 1] + path_right(L[i - 1], L[i]) + R[i] - L[i]);
	}
	// for(int i = 1; i <= n; i++){
	// 	cout << L[i] << " " << R[i] << " " << dpL[i] << " " << dpR[i] << endl;
	// }
	cout << min(dpL[n], dpR[n]) << endl;;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fs first
#define sc second

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const ll inf = 1e18 + 7;
const int maxn = 2e5 + 7;
int L[maxn], R[maxn];
ll dpL[maxn],dpR[maxn];
int n, m, k ,q;
vector<int> safe;

ll path_left(int pre_col, int nxt_col){
	ll ans = 0;
	if (safe[0] > pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] <= pre_col){
			res = mid;
			lo = mid + 1;
		}else hi = mid - 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(nxt_col - safe[res]);
	return ans;
}

ll path_right(int pre_col, int nxt_col){
	ll ans = 0;
	if (safe.back() < pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] >= pre_col){
			res = mid;
			hi = mid - 1;
		}else lo = mid + 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move right to safe col and move up
	ans += abs(safe[res] - nxt_col);
	return ans;
}

int main(){
	ios :: sync_with_stdio(false); cin.tie(0);
	cin >> n >> m >> k >> q;
	for(int i = 1; i <= n; i++){
		L[i] = 1e9;
		R[i] = -1;
	}
	L[1] = R[1] = 1;
	int x, y;
	for(int i = 1; i <= k; i++){
		cin >> x >> y;
		L[x] = min(L[x], y);
		R[x] = max(R[x], y);
	}

	for(int i = 1; i <= q; i++){
		cin >> x;
		safe.pb(x);
	}
	sort(safe.begin(), safe.end());
	dpL[1] = inf; dpR[1] = R[1] - L[1];
	while (R[n] < 0) n--;
	for(int i = 2; i <= n; i++){
		if (R[i] < 0){
			R[i] = R[i - 1];
			L[i] = L[i - 1];
			dpR[i] = dpR[i - 1] + 1;
			dpL[i] = dpL[i - 1] + 1;
			continue;
		}
		dpL[i] = inf;
		dpL[i] = min(dpL[i], dpR[i - 1] + path_left(R[i - 1], R[i]) + R[i] - L[i]);
		dpL[i] = min(dpL[i], dpR[i - 1] + path_right(R[i - 1], R[i]) + R[i] - L[i]);
		dpL[i] = min(dpL[i], dpL[i - 1] + path_left(L[i - 1], R[i]) + R[i] - L[i]);
		dpL[i] = min(dpL[i], dpL[i - 1] + path_right(L[i - 1], R[i]) + R[i] - L[i]);

		dpR[i] = inf;
		dpR[i] = min(dpR[i], dpL[i - 1] + path_left(L[i - 1], L[i]) + R[i] - L[i]);
		dpR[i] = min(dpR[i], dpL[i - 1] + path_right(L[i - 1], L[i]) + R[i] - L[i]);
		dpR[i] = min(dpR[i], dpR[i - 1] + path_left(R[i - 1], L[i]) + R[i] - L[i]);
		dpR[i] = min(dpR[i], dpR[i - 1] + path_right(R[i - 1], L[i]) + R[i] - L[i]);
	}
	// for(int i = 1; i <= n; i++){
	// 	cout << L[i] << " " << R[i] << " " << dpL[i] << " " << dpR[i] << endl;
	// }
	cout << min(dpL[n], dpR[n]) << endl;;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fs first
#define sc second

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const ll inf = 1e18 + 7;
const int maxn = 2e5 + 7;
int L[maxn], R[maxn];
ll dpL[maxn],dpR[maxn];
int n, m, k ,q;
vector<int> safe;

ll path_left(int pre_col, int nxt_col){
	ll ans = 0;
	if (safe[0] > pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] <= pre_col){
			res = mid;
			lo = mid + 1;
		}else hi = mid - 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(nxt_col - safe[res]);
	return ans;
}

ll path_right(int pre_col, int nxt_col){
	ll ans = 0;
	if (safe.back() < pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] >= pre_col){
			res = mid;
			hi = mid - 1;
		}else lo = mid + 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move right to safe col and move up
	ans += abs(safe[res] - nxt_col);
	return ans;
}

int main(){
	ios :: sync_with_stdio(false); cin.tie(0);
	cin >> n >> m >> k >> q;
	for(int i = 1; i <= n; i++){
		L[i] = 1e9;
		R[i] = -1;
	}
	L[1] = R[1] = 1;
	int x, y;
	for(int i = 1; i <= k; i++){
		cin >> x >> y;
		L[x] = min(L[x], y);
		R[x] = max(R[x], y);
	}

	for(int i = 1; i <= q; i++){
		cin >> x;
		safe.pb(x);
	}
	sort(safe.begin(), safe.end());
	dpL[1] = inf; dpR[1] = R[1] - L[1];
	while (R[n] < 0) n--;
	for(int i = 2; i <= n; i++){
		if (R[i] < 0){
			R[i] = R[i - 1];
			L[i] = L[i - 1];
			dpR[i] = dpR[i - 1] + 1;
			dpL[i] = dpL[i - 1] + 1;
			continue;
		}
		dpL[i] = inf;
		dpL[i] = min(dpL[i], dpR[i - 1] + path_left(R[i - 1], R[i]) + R[i] - L[i]);
		dpL[i] = min(dpL[i], dpR[i - 1] + path_right(R[i - 1], R[i]) + R[i] - L[i]);
		dpL[i] = min(dpL[i], dpL[i - 1] + path_left(L[i - 1], R[i]) + R[i] - L[i]);
		dpL[i] = min(dpL[i], dpL[i - 1] + path_right(L[i - 1], R[i]) + R[i] - L[i]);

		dpR[i] = inf;
		dpR[i] = min(dpR[i], dpL[i - 1] + path_left(L[i - 1], L[i]) + R[i] - L[i]);
		dpR[i] = min(dpR[i], dpL[i - 1] + path_right(L[i - 1], L[i]) + R[i] - L[i]);
		dpR[i] = min(dpR[i], dpL[i - 1] + path_left(R[i - 1], L[i]) + R[i] - L[i]);
		dpR[i] = min(dpR[i], dpL[i - 1] + path_right(R[i - 1], L[i]) + R[i] - L[i]);
	}
	// for(int i = 1; i <= n; i++){
	// 	cout << L[i] << " " << R[i] << " " << dpL[i] << " " << dpR[i] << endl;
	// }
	cout << min(dpL[n], dpR[n]) << endl;;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fs first
#define sc second

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const ll inf = 1e18 + 7;
const int maxn = 2e5 + 7;
int L[maxn], R[maxn];
ll dpL[maxn],dpR[maxn];
int n, m, k ,q;
vector<int> safe;

ll path_left(int pre_col, int nxt_col){
	ll ans = 0;
	if (safe[0] > pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] <= pre_col){
			res = mid;
			lo = mid + 1;
		}else hi = mid - 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(nxt_col - safe[res]);
	return ans;
}

ll path_right(int pre_col, int nxt_col){
	ll ans = 0;
	if (safe.back() < pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] >= pre_col){
			res = mid;
			hi = mid - 1;
		}else lo = mid + 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(safe[res] - nxt_col);
	return ans;
}

int main(){
	ios :: sync_with_stdio(false); cin.tie(0);
	cin >> n >> m >> k >> q;
	for(int i = 1; i <= n; i++){
		L[i] = 1e9;
		R[i] = -1;
	}
	L[1] = R[1] = 1;
	int x, y;
	for(int i = 1; i <= k; i++){
		cin >> x >> y;
		L[x] = min(L[x], y);
		R[x] = max(R[x], y);
	}

	for(int i = 1; i <= q; i++){
		cin >> x;
		safe.pb(x);
	}
	sort(safe.begin(), safe.end());
	dpL[1] = inf; dpR[1] = R[1] - L[1];
	while (R[n] < 0) n--;
	for(int i = 2; i <= n; i++){
		if (R[i] < 0){
			R[i] = R[i - 1];
			L[i] = L[i - 1];
			dpR[i] = dpR[i - 1] + 1;
			dpL[i] = dpL[i - 1] + 1;
			continue;
		}
		dpL[i] = inf;
		dpL[i] = min(dpL[i], dpR[i - 1] + path_left(R[i - 1], R[i]) + R[i] - L[i]);
		dpL[i] = min(dpL[i], dpR[i - 1] + path_right(R[i - 1], R[i]) + R[i] - L[i]);
		dpR[i] = inf;
		dpR[i] = min(dpR[i], dpL[i - 1] + path_left(L[i - 1], L[i]) + R[i] - L[i]);
		dpR[i] = min(dpR[i], dpL[i - 1] + path_right(L[i - 1], L[i]) + R[i] - L[i]);
	}
	// for(int i = 1; i <= n; i++){
	// 	cout << L[i] << " " << R[i] << " " << dpL[i] << " " << dpR[i] << endl;
	// }
	cout << min(dpL[n], dpR[n]) << endl;;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fs first
#define sc second

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int inf = 1e9 + 7;
const int maxn = 2e5 + 7;
int L[maxn], R[maxn];
int dpL[maxn],dpR[maxn];
int n, m, k ,q;
vector<int> safe;

int path_left(int pre_col, int nxt_col){
	int ans = 0;
	if (safe[0] > pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] <= pre_col){
			res = mid;
			lo = mid + 1;
		}else hi = mid - 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(nxt_col - safe[res]);
	return ans;
}

int path_right(int pre_col, int nxt_col){
	int ans = 0;
	if (safe.back() < pre_col) return inf;
	int lo = 0;
	int hi = q - 1;
	int res;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if (safe[mid] >= pre_col){
			res = mid;
			hi = mid - 1;
		}else lo = mid + 1;
	}
	ans += abs(pre_col - safe[res]) + 1; // move left to safe col and move up
	ans += abs(nxt_col - safe[res]);
	return ans;
}

int main(){
	ios :: sync_with_stdio(false); cin.tie(0);
	cin >> n >> m >> k >> q;
	for(int i = 1; i <= n; i++){
		L[i] = inf;
		R[i] = -inf;
	}
	L[1] = R[1] = 1;
	int x, y;
	for(int i = 1; i <= k; i++){
		cin >> x >> y;
		L[x] = min(L[x], y);
		R[x] = max(R[x], y);
	}

	for(int i = 1; i <= q; i++){
		cin >> x;
		safe.pb(x);
	}
	sort(safe.begin(), safe.end());
	dpL[1] = inf; dpR[1] = R[1] - L[1];
	while (R[n] < 0) n--;
	for(int i = 2; i <= n; i++){
		dpL[i] = inf;
		dpL[i] = min(dpL[i], dpR[i - 1] + path_left(R[i - 1], L[i]));
		dpL[i] = min(dpL[i], dpR[i - 1] + path_right(R[i - 1], L[i]));
		dpR[i] = inf;
		dpR[i] = min(dpR[i], dpL[i - 1] + path_left(L[i - 1], R[i]));
		dpR[i] = min(dpR[i], dpL[i - 1] + path_right(L[i - 1], R[i]));
	}
	cout << min(dpL[n], dpR[n]) << endl;;
	return 0;
}


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

    #define ll long long int
    #define ull unsigned long long
    #define pll pair<ll,ll>
    #define MS(x, y) memset(x, y, sizeof(x))
    #define all(x) x.begin(),x.end()
    #define ff first
    #define ss second
    #define INFL LLONG_MAX
    #define pb push_back
    #define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    const ll N = 2e5 + 5;
    const ll M = 1e5 + 5;
    const ll mod = 1e9 + 7;
    const ll m1 = 1e9 + 7;
    const ll m2 = 1e9 + 9;
    const ll p1 = 402653189;
    const ll p2 = 1610612741;
    const int LN = 32;

    ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
    ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
    ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
    ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

    ll dx[4]={-1,  1,  0,  0};
    ll dy[4]={ 0,  0,  1, -1};

    ll pw[LN],fact[N],invfact[N];

    void pre()
    {
        fact[0]=1;
        for(int i=0;i<LN;i++)pw[i]=power(2,i);
        for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
        for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
    }

    pll pos[N];
    vector <ll> col;
    set <ll> s;

    int main()
    {
        FIO;
        //pre();

        ll i,j;

        ll n,m,k,q;
        cin>>n>>m>>k>>q;

        pos[0] = {1,1};

        for(i=1;i<=k;i++)
        {
            cin>>pos[i].ff>>pos[i].ss;
            s.insert(pos[i].ff);
        }

        sort(pos,pos+k+1);

        for(i=1;i<=q;i++)
        {
            ll val;
            cin>>val;
            col.pb(val);
        }

        sort(all(col));

        vector <pll> ans;
        ans.pb({1,-1});
        ll idx = 0;

        ll fans = 0;

        for(auto it:s)
        {
            ll tmpidx = idx;
            while(tmpidx<=k && pos[tmpidx].ff == it)
                tmpidx++;
            tmpidx--;
            //cout<<"idx -> "<<idx<<"  "<<tmpidx<<"\n";

            if(tmpidx == k)
            {
                if(idx == 0)
                    fans = 1;
                else
                    fans = pos[idx].ff - pos[idx-1].ff;
                break;
            }

            vector <pll> tmpans = ans;
            ans.clear();

            /*for(auto it:tmpans)
                cout<<it.ff<<"  "<<it.ss<<"\n";
            cout<<"\n";*/

            if( tmpidx < 0 )
            {
                cout<<tmpidx<<"\n";
                return 0;
            }
            assert(tmpidx>=0);
            ll y1 = pos[idx].ss;
            ll y2 = pos[tmpidx].ss;

            ll id = upper_bound(all(col),y1) - col.begin();

            if(id != col.size())
            {
                ll tans = INFL;

                for(auto x: tmpans)
                {
                    if(x.ff<=y1)
                    {
                        if(col[id]<=y2)
                        {
                            tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                        }
                        else
                        {
                            tans = min(tans , x.ss + col[id] - x.ff);
                        }
                    }
                    else if(x.ff>=y1 && x.ff<=y2)
                    {
                        if(col[id]<=y2)
                        {
                            tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                        }
                        else
                        {
                            tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                        }
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                if(idx == 0)
                    ans.pb({col[id],tans+1});
                else
                    ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
            }

            if(id > 0)
            {
                id--;
                ll tans = INFL;

                for(auto x:tmpans)
                {
                    if(x.ff<=y1)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else if(x.ff>=y1 && x.ff<=y2)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - col[id]);
                    }
                }
                if(idx == 0)
                    ans.pb({col[id],tans+1});
                else
                    ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
            }

            id = upper_bound(all(col),y2) - col.begin();

            if(id != col.size())
            {
                ll tans = INFL;

                for(auto x:tmpans)
                {
                    if(x.ff<=y1)
                    {
                        tans = min(tans , x.ss - x.ff + col[id]);
                    }
                    else if(x.ff>=y1 && x.ff<=y2)
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                if(idx == 0)
                    ans.pb({col[id],tans+1});
                else
                    ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
            }

            if(id>0)
            {
                id--;
                ll tans = INFL;

                for(auto x: tmpans)
                {
                    if(x.ff<=y1)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else if(x.ff>=y1 && x.ff<=y2)
                    {
                        if(col[id]>=y1)
                        {
                            tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                        }
                        else
                        {
                            tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                        }
                    }
                    else
                    {
                        if(col[id] >= y1)
                        {
                            tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                        }
                        else
                        {
                            tans = min(tans , x.ss + x.ff - col[id]);
                        }
                    }
                }
                if(idx == 0)
                    ans.pb({col[id],tans+1});
                else
                    ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
            }

            idx = tmpidx + 1;
        }

        ll fin_ans = INFL;

        for(auto it:ans)
        {
            ll y1 = pos[idx].ss , y2 = pos[k].ss;

            if(it.ff <= y1)
            {
                fin_ans = min(fin_ans , fans + it.ss + y2 - it.ff);
            }
            else if(it.ff >= y1 && it.ff <= y2)
            {
                fin_ans = min(fin_ans , fans + it.ss + min(it.ff - y1 + y2 - y1 , y2 - it.ff + y2 - y1));
            }
            else
            {
                fin_ans = min(fin_ans , fans + it.ss + it.ff - y1);
            }
        }

        cout<<fin_ans;

        return 0;
    }


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

#define ll long long int
#define ull unsigned long long
#define pll pair<ll,ll>
#define MS(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define INFL LLONG_MAX
#define pb push_back
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const ll N = 3e5 + 5;
const ll M = 1e5 + 5;
const ll mod = 1e9 + 7;
const ll m1 = 1e9 + 7;
const ll m2 = 1e9 + 9;
const ll p1 = 402653189;
const ll p2 = 1610612741;
const int LN = 32;

ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll dx[4]={-1,  1,  0,  0};
ll dy[4]={ 0,  0,  1, -1};

ll pw[LN],fact[N],invfact[N];

void pre()
{
    fact[0]=1;
    for(int i=0;i<LN;i++)pw[i]=power(2,i);
    for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
    for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
}

pll pos[N];
vector <ll> col;
set <ll> s;

int main()
{
    FIO;
    //pre();

    ll i,j;

    ll n,m,k,q;
    cin>>n>>m>>k>>q;

    pos[0] = {1,1};

    for(i=1;i<=k;i++)
    {
        cin>>pos[i].ff>>pos[i].ss;
        s.insert(pos[i].ff);
    }

    sort(pos,pos+k+1);

    for(i=1;i<=q;i++)
    {
        ll val;
        cin>>val;
        col.pb(val);
    }

    sort(all(col));

    vector <pll> ans;
    ans.pb({1,-1});
    ll idx = 0;

    ll fans = 0;

    for(auto it:s)
    {
        ll tmpidx = idx;
        while(tmpidx<=k && pos[tmpidx].ff == it)
            tmpidx++;
        tmpidx--;
        //cout<<"idx -> "<<idx<<"  "<<tmpidx<<"\n";

        if(tmpidx >= k)
        {
            if(idx == 0)
                fans = 1;
            else
                fans = pos[idx].ff - pos[idx-1].ff;
            break;
        }

        vector <pll> tmpans = ans;
        ans.clear();

        /*for(auto it:tmpans)
            cout<<it.ff<<"  "<<it.ss<<"\n";
        cout<<"\n";*/

        ll y1 = pos[idx].ss;
        ll y2 = pos[tmpidx].ss;

        ll id = upper_bound(all(col),y1) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else
                    {
                        tans = min(tans , x.ss + col[id] - x.ff);
                    }
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id > 0)
        {
            id--;
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - col[id]);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        id = upper_bound(all(col),y2) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss - x.ff + col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id>0)
        {
            id--;
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]>=y1)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                }
                else
                {
                    if(col[id] >= y1)
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - col[id]);
                    }
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        idx = tmpidx + 1;
    }

    ll fin_ans = INFL;

    for(auto it:ans)
    {
        ll y1 = pos[idx].ss , y2 = pos[k].ss;

        if(it.ff <= y1)
        {
            fin_ans = min(fin_ans , fans + it.ss + y2 - it.ff);
        }
        else if(it.ff >= y1 && it.ff <= y2)
        {
            fin_ans = min(fin_ans , fans + it.ss + min(it.ff - y1 + y2 - y1 , y2 - it.ff + y2 - y1));
        }
        else
        {
            fin_ans = min(fin_ans , fans + it.ss + it.ff - y1);
        }
    }

    cout<<fin_ans;

    return 0;
}


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

#define ll long long int
#define ull unsigned long long
#define pll pair<ll,ll>
#define MS(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define INFL LLONG_MAX
#define pb push_back
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const ll N = 2e5 + 5;
const ll M = 1e5 + 5;
const ll mod = 1e9 + 7;
const ll m1 = 1e9 + 7;
const ll m2 = 1e9 + 9;
const ll p1 = 402653189;
const ll p2 = 1610612741;
const int LN = 32;

ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll dx[4]={-1,  1,  0,  0};
ll dy[4]={ 0,  0,  1, -1};

ll pw[LN],fact[N],invfact[N];

void pre()
{
    fact[0]=1;
    for(int i=0;i<LN;i++)pw[i]=power(2,i);
    for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
    for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
}

pll pos[N];
vector <ll> col;
set <ll> s;

int main()
{
    FIO;
    //pre();

    ll i,j;

    ll n,m,k,q;
    cin>>n>>m>>k>>q;

    pos[0] = {1,1};

    for(i=1;i<=k;i++)
    {
        cin>>pos[i].ff>>pos[i].ss;
        s.insert(pos[i].ff);
    }

    sort(pos,pos+k+1);

    for(i=1;i<=q;i++)
    {
        ll val;
        cin>>val;
        col.pb(val);
    }

    sort(all(col));

    vector <pll> ans;
    ans.pb({1,-1});
    ll idx = 0;

    ll fans = 0;

    for(auto it:s)
    {
        ll tmpidx = idx;
        while(tmpidx<=k && pos[tmpidx].ff == it)
            tmpidx++;
        tmpidx--;
        //cout<<"idx -> "<<idx<<"  "<<tmpidx<<"\n";

        if(tmpidx == k)
        {
            if(idx == 0)
                fans = 1;
            else
                fans = pos[idx].ff - pos[idx-1].ff;
            break;
        }

        vector <pll> tmpans = ans;
        ans.clear();

        /*for(auto it:tmpans)
            cout<<it.ff<<"  "<<it.ss<<"\n";
        cout<<"\n";*/

        ll y1 = pos[idx].ss;
        ll y2 = pos[tmpidx].ss;

        ll id = upper_bound(all(col),y1) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else
                    {
                        tans = min(tans , x.ss + col[id] - x.ff);
                    }
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id > 0)
        {
            id--;
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - col[id]);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        id = upper_bound(all(col),y2) - col.begin();

        if(id!=col.size())
        {
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss - x.ff + col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id>0)
        {
            id--;
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]>=y1)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                }
                else
                {
                    if(col[id] >= y1)
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - col[id]);
                    }
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        idx = tmpidx + 1;
    }

    ll fin_ans = INFL;

    for(auto it:ans)
    {
        ll y1 = pos[idx].ss , y2 = pos[k].ss;

        if(it.ff <= y1)
        {
            fin_ans = min(fin_ans , fans + it.ss + y2 - it.ff);
        }
        else if(it.ff >= y1 && it.ff <= y2)
        {
            fin_ans = min(fin_ans , fans + it.ss + min(it.ff - y1 + y2 - y1 , y2 - it.ff + y2 - y1));
        }
        else
        {
            fin_ans = min(fin_ans , fans + it.ss + it.ff - y1);
        }
    }

    cout<<fin_ans;

    return 0;
}


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

    #define ll long long int
    #define ull unsigned long long
    #define pll pair<ll,ll>
    #define MS(x, y) memset(x, y, sizeof(x))
    #define all(x) x.begin(),x.end()
    #define ff first
    #define ss second
    #define INFL LLONG_MAX
    #define pb push_back
    #define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    const ll N = 2e5 + 5;
    const ll M = 1e5 + 5;
    const ll mod = 1e9 + 7;
    const ll m1 = 1e9 + 7;
    const ll m2 = 1e9 + 9;
    const ll p1 = 402653189;
    const ll p2 = 1610612741;
    const int LN = 32;

    ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
    ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
    ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
    ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

    ll dx[4]={-1,  1,  0,  0};
    ll dy[4]={ 0,  0,  1, -1};

    ll pw[LN],fact[N],invfact[N];

    void pre()
    {
        fact[0]=1;
        for(int i=0;i<LN;i++)pw[i]=power(2,i);
        for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
        for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
    }

    pll pos[N];
    vector <ll> col;
    set <ll> s;

    int main()
    {
        FIO;
        //pre();

        ll i,j;

        ll n,m,k,q;
        cin>>n>>m>>k>>q;

        pos[0] = {1,1};
        s.insert(1);

        for(i=1;i<=k;i++)
        {
            cin>>pos[i].ff>>pos[i].ss;
            s.insert(pos[i].ff);
        }

        sort(pos,pos+k+1);

        for(i=1;i<=q;i++)
        {
            ll val;
            cin>>val;
            col.pb(val);
        }

        sort(all(col));

        vector <pll> ans;
        ans.pb({1,-1});
        ll idx = 0;

        ll fans = 0;

        for(auto it:s)
        {
            ll tmpidx = idx;
            while(tmpidx<=k && pos[tmpidx].ff == it)
                tmpidx++;
            tmpidx--;
            //cout<<"idx -> "<<idx<<"  "<<tmpidx<<"\n";

            if(tmpidx == k)
            {
                if(idx == 0)
                    fans = 1;
                else
                    fans = pos[idx].ff - pos[idx-1].ff;
                break;
            }

            vector <pll> tmpans = ans;
            ans.clear();

            /*for(auto it:tmpans)
                cout<<it.ff<<"  "<<it.ss<<"\n";
            cout<<"\n";*/

            ll y1 = pos[idx].ss;
            ll y2 = pos[tmpidx].ss;

            ll id = upper_bound(all(col),y1) - col.begin();

            if(id > 0)
            {
                id--;
                ll tans = INFL;

                for(auto x:tmpans)
                {
                    if(x.ff<=y1)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else if(x.ff>=y1 && x.ff<=y2)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - col[id]);
                    }
                }
                if(idx == 0)
                    ans.pb({col[id],tans+1});
                else
                    ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
            }

            id = upper_bound(all(col),y2) - col.begin();

            if(id != col.size())
            {
                ll tans = INFL;

                for(auto x:tmpans)
                {
                    if(x.ff<=y1)
                    {
                        tans = min(tans , x.ss - x.ff + col[id]);
                    }
                    else if(x.ff>=y1 && x.ff<=y2)
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                if(idx == 0)
                    ans.pb({col[id],tans+1});
                else
                    ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
            }

            idx = tmpidx + 1;
        }

        ll fin_ans = INFL;

        for(auto it:ans)
        {
            ll y1 = pos[idx].ss , y2 = pos[k].ss;

            if(it.ff <= y1)
            {
                fin_ans = min(fin_ans , fans + it.ss + y2 - it.ff);
            }
            else if(it.ff >= y1 && it.ff <= y2)
            {
                fin_ans = min(fin_ans , fans + it.ss + min(it.ff - y1 + y2 - y1 , y2 - it.ff + y2 - y1));
            }
            else
            {
                fin_ans = min(fin_ans , fans + it.ss + it.ff - y1);
            }
        }

        cout<<fin_ans;

        return 0;
    }


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

#define ll long long int
#define ull unsigned long long
#define pll pair<ll,ll>
#define MS(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define INFL LLONG_MAX
#define pb push_back
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const ll N = 2e5 + 5;
const ll M = 1e5 + 5;
const ll mod = 1e9 + 7;
const ll m1 = 1e9 + 7;
const ll m2 = 1e9 + 9;
const ll p1 = 402653189;
const ll p2 = 1610612741;
const int LN = 32;

ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll dx[4]={-1,  1,  0,  0};
ll dy[4]={ 0,  0,  1, -1};

ll pw[LN],fact[N],invfact[N];

void pre()
{
    fact[0]=1;
    for(int i=0;i<LN;i++)pw[i]=power(2,i);
    for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
    for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
}

pll pos[N];
vector <ll> col;
set <ll> s;

int main()
{
    FIO;
    //pre();

    ll i,j;

    ll n,m,k,q;
    cin>>n>>m>>k>>q;

    pos[0] = {1,1};

    for(i=1;i<=k;i++)
    {
        cin>>pos[i].ff>>pos[i].ss;
        s.insert(pos[i].ff);
    }

    sort(pos,pos+k+1);

    for(i=1;i<=q;i++)
    {
        ll val;
        cin>>val;
        col.pb(val);
    }

    sort(all(col));

    vector <pll> ans;
    ans.pb({1,-1});
    ll idx = 0;

    ll fans = 0;

    for(auto it:s)
    {
        ll tmpidx = idx;
        while(tmpidx<=k && pos[tmpidx].ff == it)
            tmpidx++;
        tmpidx--;
        //cout<<"idx -> "<<idx<<"  "<<tmpidx<<"\n";

        if(tmpidx == k)
        {
            if(idx == 0)
                fans = 1;
            else
                fans = pos[idx].ff - pos[idx-1].ff;
            break;
        }

        vector <pll> tmpans = ans;
        ans.clear();

        /*for(auto it:tmpans)
            cout<<it.ff<<"  "<<it.ss<<"\n";
        cout<<"\n";*/

        assert(tmpidx>=0 && tmpidx<=k);
        ll y1 = pos[idx].ss;
        ll y2 = pos[tmpidx].ss;

        ll id = upper_bound(all(col),y1) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else
                    {
                        tans = min(tans , x.ss + col[id] - x.ff);
                    }
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id > 0)
        {
            id--;
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - col[id]);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        id = upper_bound(all(col),y2) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss - x.ff + col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id>0)
        {
            id--;
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]>=y1)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                }
                else
                {
                    if(col[id] >= y1)
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - col[id]);
                    }
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        idx = tmpidx + 1;
    }

    ll fin_ans = INFL;

    for(auto it:ans)
    {
        ll y1 = pos[idx].ss , y2 = pos[k].ss;

        if(it.ff <= y1)
        {
            fin_ans = min(fin_ans , fans + it.ss + y2 - it.ff);
        }
        else if(it.ff >= y1 && it.ff <= y2)
        {
            fin_ans = min(fin_ans , fans + it.ss + min(it.ff - y1 + y2 - y1 , y2 - it.ff + y2 - y1));
        }
        else
        {
            fin_ans = min(fin_ans , fans + it.ss + it.ff - y1);
        }
    }

    cout<<fin_ans;

    return 0;
}


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

#define ll long long int
#define ull unsigned long long
#define pll pair<ll,ll>
#define MS(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define INFL LLONG_MAX
#define pb push_back
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const ll N = 2e5 + 5;
const ll M = 1e5 + 5;
const ll mod = 1e9 + 7;
const ll m1 = 1e9 + 7;
const ll m2 = 1e9 + 9;
const ll p1 = 402653189;
const ll p2 = 1610612741;
const int LN = 32;

ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll dx[4]={-1,  1,  0,  0};
ll dy[4]={ 0,  0,  1, -1};

ll pw[LN],fact[N],invfact[N];

void pre()
{
    fact[0]=1;
    for(int i=0;i<LN;i++)pw[i]=power(2,i);
    for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
    for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
}

pll pos[N];
vector <ll> col;
set <ll> s;

int main()
{
    FIO;
    //pre();

    ll i,j;

    ll n,m,k,q;
    cin>>n>>m>>k>>q;

    pos[0] = {1,1};

    for(i=1;i<=k;i++)
    {
        cin>>pos[i].ff>>pos[i].ss;
        s.insert(pos[i].ff);
    }

    sort(pos,pos+k+1);

    for(i=1;i<=q;i++)
    {
        ll val;
        cin>>val;
        col.pb(val);
    }

    sort(all(col));

    vector <pll> ans;
    ans.pb({1,-1});
    ll idx = 0;

    ll fans = 0;

    for(auto it:s)
    {
        ll tmpidx = idx;
        while(tmpidx<=k && pos[tmpidx].ff == it)
            tmpidx++;
        tmpidx--;
        //cout<<"idx -> "<<idx<<"  "<<tmpidx<<"\n";

        if(tmpidx == k)
        {
            if(idx == 0)
                fans = 1;
            else
                fans = pos[idx].ff - pos[idx-1].ff;
            break;
        }

        vector <pll> tmpans = ans;
        ans.clear();

        /*for(auto it:tmpans)
            cout<<it.ff<<"  "<<it.ss<<"\n";
        cout<<"\n";*/

        assert(tmpidx>=0);
        ll y1 = pos[idx].ss;
        ll y2 = pos[tmpidx].ss;

        ll id = upper_bound(all(col),y1) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else
                    {
                        tans = min(tans , x.ss + col[id] - x.ff);
                    }
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id > 0)
        {
            id--;
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - col[id]);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        id = upper_bound(all(col),y2) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss - x.ff + col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id>0)
        {
            id--;
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]>=y1)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                }
                else
                {
                    if(col[id] >= y1)
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - col[id]);
                    }
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        idx = tmpidx + 1;
    }

    ll fin_ans = INFL;

    for(auto it:ans)
    {
        ll y1 = pos[idx].ss , y2 = pos[k].ss;

        if(it.ff <= y1)
        {
            fin_ans = min(fin_ans , fans + it.ss + y2 - it.ff);
        }
        else if(it.ff >= y1 && it.ff <= y2)
        {
            fin_ans = min(fin_ans , fans + it.ss + min(it.ff - y1 + y2 - y1 , y2 - it.ff + y2 - y1));
        }
        else
        {
            fin_ans = min(fin_ans , fans + it.ss + it.ff - y1);
        }
    }

    cout<<fin_ans;

    return 0;
}


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

#define ll long long int
#define ull unsigned long long
#define pll pair<ll,ll>
#define MS(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define INFL LLONG_MAX
#define pb push_back
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const ll N = 2e5 + 5;
const ll M = 1e5 + 5;
const ll mod = 1e9 + 7;
const ll m1 = 1e9 + 7;
const ll m2 = 1e9 + 9;
const ll p1 = 402653189;
const ll p2 = 1610612741;
const int LN = 32;

ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll dx[4]={-1,  1,  0,  0};
ll dy[4]={ 0,  0,  1, -1};

ll pw[LN],fact[N],invfact[N];

void pre()
{
    fact[0]=1;
    for(int i=0;i<LN;i++)pw[i]=power(2,i);
    for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
    for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
}

pll pos[N];
vector <ll> col;
set <ll> s;

int main()
{
    FIO;
    //pre();

    ll i,j;

    ll n,m,k,q;
    cin>>n>>m>>k>>q;

    pos[0] = {1,1};

    for(i=1;i<=k;i++)
    {
        cin>>pos[i].ff>>pos[i].ss;
        s.insert(pos[i].ff);
    }

    sort(pos,pos+k+1);

    for(i=1;i<=q;i++)
    {
        ll val;
        cin>>val;
        col.pb(val);
    }

    sort(all(col));

    vector <pll> ans;
    ans.pb({1,-1});
    ll idx = 0;

    ll fans = 0;

    for(auto it:s)
    {
        ll tmpidx = idx;
        while(tmpidx<=k && pos[tmpidx].ff == it)
            tmpidx++;
        tmpidx--;
        //cout<<"idx -> "<<idx<<"  "<<tmpidx<<"\n";

        if(tmpidx == k)
        {
            if(idx == 0)
                fans = 1;
            else
                fans = pos[idx].ff - pos[idx-1].ff;
            break;
        }

        vector <pll> tmpans = ans;
        ans.clear();

        /*for(auto it:tmpans)
            cout<<it.ff<<"  "<<it.ss<<"\n";
        cout<<"\n";*/

        if( tmpidx < 0 )
        {
            cerr<<tmpidx<<"\n";
            return 0;
        }
        assert(tmpidx>=0);
        ll y1 = pos[idx].ss;
        ll y2 = pos[tmpidx].ss;

        ll id = upper_bound(all(col),y1) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else
                    {
                        tans = min(tans , x.ss + col[id] - x.ff);
                    }
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id > 0)
        {
            id--;
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - col[id]);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        id = upper_bound(all(col),y2) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss - x.ff + col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id>0)
        {
            id--;
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]>=y1)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                }
                else
                {
                    if(col[id] >= y1)
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - col[id]);
                    }
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        idx = tmpidx + 1;
    }

    ll fin_ans = INFL;

    for(auto it:ans)
    {
        ll y1 = pos[idx].ss , y2 = pos[k].ss;

        if(it.ff <= y1)
        {
            fin_ans = min(fin_ans , fans + it.ss + y2 - it.ff);
        }
        else if(it.ff >= y1 && it.ff <= y2)
        {
            fin_ans = min(fin_ans , fans + it.ss + min(it.ff - y1 + y2 - y1 , y2 - it.ff + y2 - y1));
        }
        else
        {
            fin_ans = min(fin_ans , fans + it.ss + it.ff - y1);
        }
    }

    cout<<fin_ans;

    return 0;
}


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

#define ll long long int
#define ull unsigned long long
#define pll pair<ll,ll>
#define MS(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define INFL LLONG_MAX
#define pb push_back
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const ll N = 2e5 + 5;
const ll M = 1e5 + 5;
const ll mod = 1e9 + 7;
const ll m1 = 1e9 + 7;
const ll m2 = 1e9 + 9;
const ll p1 = 402653189;
const ll p2 = 1610612741;
const int LN = 32;

ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll dx[4]={-1,  1,  0,  0};
ll dy[4]={ 0,  0,  1, -1};

ll pw[LN],fact[N],invfact[N];

void pre()
{
    fact[0]=1;
    for(int i=0;i<LN;i++)pw[i]=power(2,i);
    for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
    for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
}

pll pos[N];
vector <ll> col;
set <ll> s;

int main()
{
    FIO;
    //pre();

    ll i,j;

    ll n,m,k,q;
    cin>>n>>m>>k>>q;

    pos[0] = {1,1};

    for(i=1;i<=k;i++)
    {
        cin>>pos[i].ff>>pos[i].ss;
        s.insert(pos[i].ff);
    }

    sort(pos,pos+k+1);

    for(i=1;i<=q;i++)
    {
        ll val;
        cin>>val;
        col.pb(val);
    }

    sort(all(col));

    vector <pll> ans;
    ans.pb({1,-1});
    ll idx = 0;

    ll fans = 0;

    for(auto it:s)
    {
        ll tmpidx = idx;
        while(tmpidx<=k && pos[tmpidx].ff == it)
            tmpidx++;
        tmpidx--;
        //cout<<"idx -> "<<idx<<"  "<<tmpidx<<"\n";

        if(tmpidx == k)
        {
            if(idx == 0)
                fans = 1;
            else
                fans = pos[idx].ff - pos[idx-1].ff;
            break;
        }

        vector <pll> tmpans = ans;
        ans.clear();

        /*for(auto it:tmpans)
            cout<<it.ff<<"  "<<it.ss<<"\n";
        cout<<"\n";*/

        assert(tmpidx<=k);
        ll y1 = pos[idx].ss;
        ll y2 = pos[tmpidx].ss;

        ll id = upper_bound(all(col),y1) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else
                    {
                        tans = min(tans , x.ss + col[id] - x.ff);
                    }
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id > 0)
        {
            id--;
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - col[id]);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        id = upper_bound(all(col),y2) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss - x.ff + col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id>0)
        {
            id--;
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]>=y1)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                }
                else
                {
                    if(col[id] >= y1)
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - col[id]);
                    }
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        idx = tmpidx + 1;
    }

    ll fin_ans = INFL;

    for(auto it:ans)
    {
        ll y1 = pos[idx].ss , y2 = pos[k].ss;

        if(it.ff <= y1)
        {
            fin_ans = min(fin_ans , fans + it.ss + y2 - it.ff);
        }
        else if(it.ff >= y1 && it.ff <= y2)
        {
            fin_ans = min(fin_ans , fans + it.ss + min(it.ff - y1 + y2 - y1 , y2 - it.ff + y2 - y1));
        }
        else
        {
            fin_ans = min(fin_ans , fans + it.ss + it.ff - y1);
        }
    }

    cout<<fin_ans;

    return 0;
}


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

#define ll long long int
#define ull unsigned long long
#define pll pair<ll,ll>
#define MS(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define INFL LLONG_MAX
#define pb push_back
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const ll N = 2e5 + 5;
const ll M = 1e5 + 5;
const ll mod = 1e9 + 7;
const ll m1 = 1e9 + 7;
const ll m2 = 1e9 + 9;
const ll p1 = 402653189;
const ll p2 = 1610612741;
const int LN = 32;

ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll dx[4]={-1,  1,  0,  0};
ll dy[4]={ 0,  0,  1, -1};

ll pw[LN],fact[N],invfact[N];

void pre()
{
    fact[0]=1;
    for(int i=0;i<LN;i++)pw[i]=power(2,i);
    for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
    for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
}

pll pos[N];
vector <ll> col;
set <ll> s;

int main()
{
    FIO;
    //pre();

    ll i,j;

    ll n,m,k,q;
    cin>>n>>m>>k>>q;

    pos[0] = {1,1};
    s.insert(1);

    for(i=1;i<=k;i++)
    {
        cin>>pos[i].ff>>pos[i].ss;
        s.insert(pos[i].ff);
    }

    sort(pos,pos+k+1);

    for(i=1;i<=q;i++)
    {
        ll val;
        cin>>val;
        col.pb(val);
    }

    sort(all(col));

    vector <pll> ans;
    ans.pb({1,-1});
    ll idx = 0;

    ll fans = 0;

    for(auto it:s)
    {
        ll tmpidx = idx;
        while(tmpidx<=k && pos[tmpidx].ff == it)
            tmpidx++;
        tmpidx--;
        //cout<<"idx -> "<<idx<<"  "<<tmpidx<<"\n";

        if(tmpidx == k)
        {
            if(idx == 0)
                fans = 1;
            else
                fans = pos[idx].ff - pos[idx-1].ff;
            break;
        }

        vector <pll> tmpans = ans;
        ans.clear();

        /*for(auto it:tmpans)
            cout<<it.ff<<"  "<<it.ss<<"\n";
        cout<<"\n";*/

        ll y1 = pos[idx].ss;
        ll y2 = pos[tmpidx].ss;

        ll id = upper_bound(all(col),y1) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                    else
                    {
                        tans = min(tans , x.ss + col[id] - x.ff);
                    }
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]<=y2)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id > 0)
        {
            id--;
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - col[id]);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        id = upper_bound(all(col),y2) - col.begin();

        if(id != col.size())
        {
            ll tans = INFL;

            for(auto x:tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss - x.ff + col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
                else
                {
                    tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        if(id>0)
        {
            id--;
            ll tans = INFL;

            for(auto x: tmpans)
            {
                if(x.ff<=y1)
                {
                    tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                }
                else if(x.ff>=y1 && x.ff<=y2)
                {
                    if(col[id]>=y1)
                    {
                        tans = min(tans , x.ss + min( y2 - x.ff + y2 - y1 + col[id] - y1 , x.ff - y1 + y2 - y1 + y2 - col[id]));
                    }
                    else
                    {
                        tans = min(tans , x.ss + y2 - x.ff + y2 - col[id]);
                    }
                }
                else
                {
                    if(col[id] >= y1)
                    {
                        tans = min(tans , x.ss + x.ff - y1 + col[id] - y1);
                    }
                    else
                    {
                        tans = min(tans , x.ss + x.ff - col[id]);
                    }
                }
            }
            if(idx == 0)
                ans.pb({col[id],tans+1});
            else
                ans.pb({col[id],tans + pos[idx].ff - pos[idx-1].ff});
        }

        idx = tmpidx + 1;
    }

    ll fin_ans = INFL;

    for(auto it:ans)
    {
        ll y1 = pos[idx].ss , y2 = pos[k].ss;

        if(it.ff <= y1)
        {
            fin_ans = min(fin_ans , fans + it.ss + y2 - it.ff);
        }
        else if(it.ff >= y1 && it.ff <= y2)
        {
            fin_ans = min(fin_ans , fans + it.ss + min(it.ff - y1 + y2 - y1 , y2 - it.ff + y2 - y1));
        }
        else
        {
            fin_ans = min(fin_ans , fans + it.ss + it.ff - y1);
        }
    }

    cout<<fin_ans;

    return 0;
}