#include <iostream>  // cin,cout
#include <stdio.h>   // printf,scanf (standard input/output)
#include <cmath>     // abs(x),pow(x,2)
#include <string>
#include <string.h>  // strlen, strcmp
#include <algorithm> // min,max, sort(v.begin(),v.end())
#include <vector>
#include <time.h>
using namespace std;

struct Data{
    long long a;
    long long index;
    
    bool operator<( const Data& right ) const {
        return a < right.a;
        //return A < right.A;
    }
};

struct Data2{
    int index;
    long long a;
    
    bool operator<( const Data2& right ) const {
        return index < right.index;
        //return A < right.A;
    }
};


int Func(int T, vector<int> v){
    int M = v.size();
    
    int MP = 0;
    MP += 10*(M-1);

    int temp = 0;
    for (int i=0;i<M;i++) {
        temp += v[i];
    }
    MP += abs(temp-T);
    return MP;
}

int main(){
    int A, B, Q;
    long long s[100000];
    long long t[100000];
    Data u[200000];
    vector<Data> x;
    vector<Data2> result;
    
    // 入力
    cin >> A >> B >> Q;
    for (int i=0;i<A;i++) cin >> s[i];
    for (int i=0;i<B;i++) cin >> t[i];
    for (int i=0;i<Q;i++) {
        Data temp;
        cin >> temp.a;
        temp.index = i;
        x.push_back(temp);
    }
    
    int count_s = 0;
    int count_t = 0;
    if (s[0] < t[0]) {
        u[0].a = s[0];
        u[0].index = t[0]-s[0];
        count_s += 1;
    }
    else {
        u[0].a = t[0];
        u[0].index = s[0]-t[0];
        count_t += 1;
    }
    while (count_s!=A and count_t!=B) {
        if (s[count_s] > t[count_t]) {
            u[count_s+count_t].a = t[count_t];
            if (count_s==0) u[count_s+count_t].index = s[count_s]-t[count_t];
            else u[count_s+count_t].index = min(s[count_s]-t[count_t], t[count_t]-s[count_s-1]);
            count_t += 1;
        }
        else {
            u[count_s+count_t].a = s[count_s];
            if (count_t==0) u[count_s+count_t].index = t[count_t]-s[count_s];
            else u[count_s+count_t].index = min(t[count_t]-s[count_s], s[count_s]-t[count_t-1]);
            count_s += 1;
        }
    }
    
    //for (int i=0;i<A+B;i++) cout << u[i].a << " " << u[i].index << endl;
    
    if (count_s==A) {
        while (count_t<B){
            u[A+count_t].a = t[count_t];
            u[A+count_t].index = t[count_t] - s[A-1];
            count_t += 1;
        }
    }
    else {
        while (count_s<A){
            u[count_s+B].a = s[count_s];
            u[count_s+B].index = s[count_s] - t[B-1];
            count_s += 1;
        }
    }
    
    sort(x.begin(),x.end());
    //for (int i=0;i<Q;i++) cout << x[i].a << endl;
    
    int index_u = 0;
    for (int i=0;i<Q;i++) {
        while (u[index_u].a<x[i].a) {
            if (index_u!=A+B-1) index_u += 1;
            else break;
        }
        long long temp = abs(u[index_u].a-x[i].a) + u[index_u].index;
        long long temp2;
        if (index_u>0) temp2 = abs(x[i].a-u[index_u-1].a)+u[index_u-1].index;
        else temp2 = temp;
        
        Data2 temp_Data;
        temp_Data.a = min(temp,temp2);
        temp_Data.index = x[i].index;
        result.push_back(temp_Data);
    }
    
    sort(result.begin(),result.end());
    
    // 出力
    //cout << MP_min << endl;
    //for (int i=0;i<A+B;i++) cout << u[i].a << " " << u[i].index << endl;
    for (int i=0;i<Q;i++) cout << result[i].a << endl;
    
    return 0;
}


Measured memory_bytes: 9584