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

int main() {
    ll A,B,Q;
    cin >> A >> B >> Q;
    vector<ll> s(A+2), t(B+2);
    s[0] = -1001001001001001001;
    s[A+1] = 1001001001001001001;
    t[0] = s[0];
    t[B+1] = s[A+1];
    for(int i=1; i<=A; ++i) cin >> s[i];
    for(int i=1; i<=B; ++i) cin >> t[i];

    for(int i=0; i<Q; ++i) {
        ll x; cin >> x;

        int ns = upper_bound(s.begin(), s.end(), x) - s.begin();
        int nt = upper_bound(t.begin(), t.end(), x) - t.begin();

        ll res = 1001001001001001001;
        for(int j=0; j<2; ++j) {
            for(int k=0; k<2; ++k) {
                ll d1 = abs(s[ns-j] - x) + abs(s[ns-j] - t[nt-k]);
                ll d2 = abs(t[nt-k] - x) + abs(s[ns-j] - t[nt-k]);
                res = min({res, d1, d2});
            }
        }
        cout << res << endl;
    }
}