#include <iostream>
#include <algorithm>
#include <vector>
#include <stdint.h>
#include <assert.h>
using namespace std;

#ifdef MYDBG
template<class T>
inline T dbg(const char* label, T t) {
    cerr << label << ": " << t << endl;
    return t;
}
#else
template<class T>
inline T dbg(const char* label, T t) {
    return t;
}
#endif

inline int64_t mymax(int64_t a, int64_t b)
{
    return a < b ? b : a;
}

inline int64_t mymin(int64_t a, int64_t b)
{
    return a > b ? b : a;
}

inline int64_t myabs(int64_t a)
{
    return a < 0 ? -a : a;
}

template<class ForwardIterator>
inline ForwardIterator zengo_(ForwardIterator first, ForwardIterator last, ForwardIterator pos, int64_t target)
{
    if (pos == last) {
        // target以上の要素はなかった
        // 一番近いのは末尾 (first==lastじゃないと仮定している)
        return last - 1;
    }
    if (pos == first) {
        // targetより小さい要素はないので、一番近いのはpos
        return pos;
    }
    int64_t dist1 = *pos - target;
    int64_t dist2 = target - *(pos - 1);
    if(dist1 <= dist2) return pos;
    return pos - 1;
}

template <class ForwardIterator>
inline ForwardIterator zengo(ForwardIterator first, ForwardIterator last, ForwardIterator pos, int64_t target)
{
    auto it = zengo_(first, last, pos, target);
    //assert(first <= it);
    //assert(it <= last);
    return it;
}

int main() {
    int a, b, q;
    cin >> a >> b >> q;
    vector<int64_t> s, t;
    s.reserve(a);
    t.reserve(b);
    for (int i=0; i<a; i++) {
        int64_t x;
        cin >> x;
        s.push_back(x);
    }
    for (int i=0; i<a; i++) {
        dbg("s[i]", s[i]);
    }
    for (int i=0; i<b; i++) {
        int64_t x;
        cin >> x;
        t.push_back(x);
    }
    for (int i=0; i<b; i++) {
        dbg("t[i]", t[i]);
    }
    for (int i=0; i<q; i++) {
        int64_t x;
        int64_t dist = 0;
        cin >> x;
        int64_t dist1;
        {
            int64_t dist11 = 1LLU << 61, dist12 = 1LLU << 61;
            auto lb_s = lower_bound(s.begin(), s.end(), x);
            if (lb_s != s.end()) {
                auto lb_t = lower_bound(t.begin(), t.end(), *lb_s);
                auto goal = zengo(t.begin(), t.end(), lb_t, *lb_s);
                dist11 = myabs(*lb_s - x) + myabs(*goal - *lb_s);
                dbg("dist11", dist11);
            }
            if (lb_s != s.begin()) {
                auto lb_t = lower_bound(t.begin(), t.end(), *(lb_s - 1));
                auto goal = zengo(t.begin(), t.end(), lb_t, *(lb_s - 1));
                dist12 = myabs(*(lb_s - 1) - x) + myabs(*goal - *(lb_s - 1));
                dbg("dist12", dist12);
            }
            dist1 = mymin(dist11, dist12);
        }
        int64_t dist2;
        {
            int64_t dist21 = 1LLU << 61, dist22 = 1LLU << 61;
            auto lb_t = lower_bound(t.begin(), t.end(), x);
            if (lb_t != t.end()) {
                auto lb_s = lower_bound(s.begin(), s.end(), *lb_t);
                auto goal = zengo(s.begin(), s.end(), lb_s, *lb_t);
                dist21 = myabs(*lb_t - x) + myabs(*goal - *lb_t);
                dbg("dist21", dist21);
            }
            if (lb_t != t.begin()) {
                auto lb_s = lower_bound(s.begin(), s.end(), *(lb_t - 1));
                auto goal = zengo(s.begin(), s.end(), lb_s, *(lb_t - 1));
                dist22 = myabs(*(lb_t - 1) - x) + myabs(*goal - *(lb_t - 1));
                dbg("dist22", dist22);
            }
            dist2 = mymin(dist21, dist22);
        }
        if (dist1 < dist2) {
            cout << dist1 << endl;
        }
        else {
            cout << dist2 << endl;
        }
    }
}


Measured memory_bytes: 2944