/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
//#include <unordered_set> //unordered_set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
#define endl "\n";
using namespace std;

const long long INF = 4000000000000000001;
const int inf = 1001001001;
const int MOD = 1000000007;
typedef pair<long long,long long> P;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //When end-of-a bit is 1, times simple N.
    if (M & 1) res = (res * N) % MOD;
    return res %= MOD;
}
long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b ;
}

int binary_search_shrine(long long start,int left,int right,vector<long long> &shrine,bool bigger){
    while(right - left > 1){
        int mid = left+(right-left)/2;
        if(start > shrine.at(mid)){
            left = mid;
        }
        else{
            right = mid;
        }
        //cout << mid << " " << left << " " << right << endl;
    }
    if(bigger){
        return right;
    }
    else{
        return left;
    }
}

int binary_search_temple(long long start,int left,int right,vector<long long> &temple,bool bigger){
    while(right - left > 1){
        int mid = left+(right-left)/2;
        if(start > temple.at(mid)){
            left = mid;
        }
        else{
            right = mid;
        }
    }
    if(bigger){
        return right;
    }
    else{
        return left;
    }
}

int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
 
    //左に突き進む 右に突き進む 左右の寺社に進むの3通りの最小値でよさそう
    int A,B,Q;cin >> A >> B >> Q;
    vector<long long> shrine(A),temple(B);
    for(int i = 0;i<A;i++) cin >> shrine.at(i);
    for(int i = 0;i<B;i++) cin >> temple.at(i);
    shrine.push_back(-INF),shrine.push_back(INF);
    temple.push_back(-INF),temple.push_back(INF);
    sort(shrine.begin(),shrine.end());
    sort(temple.begin(),temple.end());
    vector<long long> OUTPUT;

    for(int i = 0;i<Q;i++){
        long long start;cin >> start;
        long long leftOnly = INF,rightOnly = INF,leftright = INF;
        //左に突き進む時の訪れ方
        //現在位置startより小さくて一番近い寺社をそれぞれ選ぶ
        int left = 0,right = A+1;
        long long LeftShrine = shrine.at(binary_search_shrine(start,left,right,shrine,0));
        left = 0,right = B+1;
        long long LeftTemple = temple.at(binary_search_temple(start,left,right,temple,0));
        leftOnly = abs(start-min(LeftTemple,LeftShrine));
        //右に突き進む
        //現在位置より大きくて一番近い寺社をそれぞれ選ぶ
        left = 0,right = A+1;
        long long RightShrine = shrine.at(binary_search_shrine(start,left,right,shrine,1));
        left = 0,right = B+1;
        long long RightTemple = temple.at(binary_search_temple(start,left,right,temple,1));
        rightOnly = abs(max(RightTemple,RightShrine)-start);
        //左右の寺社を訪れる
        //現在位置と近い方までの道のり+寺社間の距離
        leftright = min({abs(RightShrine-LeftTemple+min(start-LeftTemple,RightShrine-start)) , abs(RightTemple-LeftShrine+min(start-LeftShrine,RightTemple-start))});
        OUTPUT.push_back(min({leftOnly,rightOnly,leftright}));
    }
    for(long long V : OUTPUT) cout << V << endl;
}

Measured memory_bytes: 6500