#include <bits/stdc++.h>

using namespace std;

#define REP(var, n)  for (int var = 0; var < (n); var++)
#define RREP(var, n)  for (auto var = n - 1; var != static_cast<int>(-1); var--)
#define FOR(var, a, b)  for (auto var = (a); var < (b); var++)
#define RFOR(var, a, b)  for (auto var = b - 1; var != a; var--)

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> pii;

#define all(c) begin(c),end(c)

#define D(x) do { std::cerr << x << " "; } while (0)
#define D2(x) do { std::cerr << #x << ": " << x << std::endl; } while (0)


template<typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
    if (!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}


template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    return os << '(' << p.first << ',' << p.second << ')';
}


template<class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}


auto solve() {
    int A, B, Q;
    cin >> A >> B >> Q;

    vll s(A), revs(A);
    for (auto &&e:s) cin >> e;
    REP(i, A) revs[i] = s[i] * -1;
    reverse(all(revs));

    vll t(B), revt(B);
    for (auto &&e:t) cin >> e;
    REP(i, B) revt[i] = t[i] * -1;
    reverse(all(revt));

    while (Q--) {
        ll x;
        cin >> x;

        const ll LINF = 1ll << 60;
        ll res = LINF;

        // right
        {
            auto its = lower_bound(all(s), x);
            auto itt = lower_bound(all(t), x);
            if (its != end(s) && itt != end(t)) {
                chmin(res, max(*its, *itt) - x);
            }
        }
        // left
        {
            auto its = lower_bound(all(revs), x * -1);
            auto itt = lower_bound(all(revt), x * -1);
            if (its != end(revs) && itt != end(revt)) {
                chmin(res, x - max(*its, *itt) * -1);
            }
        }
        // rl lr
        {
            auto its = lower_bound(all(s), x);
            auto itt = lower_bound(all(revt), x * -1);
            if (its != end(s) && itt != end(revt)) {
                ll diff1 = *its - x;
                ll diff2 = x - *itt * -1;
                chmin(res, diff1 * 2 + diff2);
                chmin(res, diff2 * 2 + diff1);
            }
        }
        {
            auto its = lower_bound(all(revs), x * -1);
            auto itt = lower_bound(all(t), x);
            if (its != end(revs) && itt != end(t)) {
                ll diff1 = *itt - x;
                ll diff2 = x - *its * -1;
                chmin(res, diff1 * 2 + diff2);
                chmin(res, diff2 * 2 + diff1);
            }
        }

        cout << res << endl;
    }

}


int main() {
    cout.precision(30);
    cin.tie(0);
    ios::sync_with_stdio(false);

//    cout << (solve() ? "Heisei" : "TBD") << endl;
//    cout << (solve() ? "YES" : "NO") << endl;
//    cout << solve() << endl;
    solve();

    return 0;
}

Measured memory_bytes: 4480