#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair<ll, ll>;
using namespace std;

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main()
{
    int A, B, Q;
    cin >> A >> B >> Q;
    vector<ll> s(A), t(B);
    rep(i, A) cin >> s[i];
    rep(i, B) cin >> t[i];
    sort(s.begin(), s.end());
    sort(t.begin(), t.end());
    rep(i, Q) {
        ll x;
        cin >> x;
        ll mi = 1e18;

        // 神社から始めた場合
        {
            int sidx = lower_bound(s.begin(), s.end(), x) - s.begin();
            int ridx = -1, lidx = -1;
            if (sidx == A) {
                lidx = sidx-1;
            }
            else if (sidx == 0) {
                ridx = 0;
            }
            else {
                ridx = sidx;
                lidx = sidx-1;
            }

            // 左
            if (ridx != -1)
            {
                int tidx = lower_bound(t.begin(), t.end(), s[ridx]) - t.begin();
                int r2idx = -1, l2idx = -1;
                if (tidx == B) {
                    l2idx = tidx-1;
                }
                else if (tidx == 0) {
                    r2idx = 0;
                }
                else {
                    r2idx = tidx;
                    l2idx = tidx-1;
                }

                if (r2idx != -1) {
                    mi = min(mi, abs(x-s[ridx]) + abs(s[ridx]-t[r2idx]));
                }
                if (l2idx != -1) {
                    mi = min(mi, abs(x-s[ridx]) + abs(s[ridx]-t[l2idx]));
                }
            }
            if (lidx != -1)
            {
                int tidx = lower_bound(t.begin(), t.end(), s[lidx]) - t.begin();
                int r2idx = -1, l2idx = -1;
                if (tidx == B) {
                    l2idx = tidx-1;
                }
                else if (tidx == 0) {
                    r2idx = 0;
                }
                else {
                    r2idx = tidx;
                    l2idx = tidx-1;
                }

                if (r2idx != -1) {
                    mi = min(mi, abs(x-s[lidx]) + abs(s[lidx]-t[r2idx]));
                }
                if (l2idx != -1) {
                    mi = min(mi, abs(x-s[lidx]) + abs(s[lidx]-t[l2idx]));
                }
            }
        }

        // 寺から始めた場合
        {
            int tidx = lower_bound(t.begin(), t.end(), x) - t.begin();
            int ridx = -1, lidx = -1;
            if (tidx == B) {
                lidx = tidx-1;
            }
            else if (tidx == 0) {
                ridx = 0;
            }
            else {
                ridx = tidx;
                lidx = tidx-1;
            }

            // 左
            if (ridx != -1)
            {
                int sidx = lower_bound(s.begin(), s.end(), t[ridx]) - s.begin();
                int r2idx = -1, l2idx = -1;
                if (sidx == A) {
                    l2idx = sidx-1;
                }
                else if (sidx == 0) {
                    r2idx = 0;
                }
                else {
                    r2idx = sidx;
                    l2idx = sidx-1;
                }

                if (r2idx != -1) {
                    mi = min(mi, abs(x-t[ridx]) + abs(t[ridx]-s[r2idx]));
                }
                if (l2idx != -1) {
                    mi = min(mi, abs(x-t[ridx]) + abs(t[ridx]-s[l2idx]));
                }
            }
            if (lidx != -1)
            {
                int sidx = lower_bound(s.begin(), s.end(), t[lidx]) - s.begin();
                int r2idx = -1, l2idx = -1;
                if (sidx == A) {
                    l2idx = sidx-1;
                }
                else if (sidx == 0) {
                    r2idx = 0;
                }
                else {
                    r2idx = sidx;
                    l2idx = sidx-1;
                }

                if (r2idx != -1) {
                    mi = min(mi, abs(x-t[lidx]) + abs(t[lidx]-s[r2idx]));
                }
                if (l2idx != -1) {
                    mi = min(mi, abs(x-t[lidx]) + abs(t[lidx]-s[l2idx]));
                }
            }
        }

        cout << mi << endl;
    }
}


Measured memory_bytes: 2944