#include <limits.h>
#include <stdio.h>
#include <cmath>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <functional>
#include <algorithm>

using namespace std;



//ABC 119D

typedef long	DWORD;
typedef unsigned long U_DWORD;
typedef long long QWORD;
typedef unsigned long long U_QWORD;
typedef short WORD;
typedef unsigned short U_WORD;
typedef bool	BOOL;
typedef pair<U_QWORD, U_QWORD> PAIR;

#define N_MAX		(100000)
#define INF			(100000000000000)


DWORD shrine_num, temple_num, start_num;
vector<QWORD> vShrine, vTemple, vStart;

void inputInit(vector<QWORD> &vec, DWORD input_num)
{
	for (int i = 0; i < input_num; i++) {
		QWORD number;
		cin >> number;
		vec.push_back(number);
	}

}

static bool Judge(vector<QWORD> &vec, QWORD pos, U_DWORD mid)
{
	if (vec[mid] >= pos) return true;
	return false;
}

U_DWORD BinarySearch(vector<QWORD> &vec, QWORD pos)
{

	 U_DWORD lb = 0, ub = vec.size();

	 while (ub - lb > 1) {
		 U_DWORD	mid = (ub + lb) / 2;

		if (Judge(vec, pos, mid)) ub = mid;
		else lb = mid;
	 }

	 return lb;
}

QWORD getDistanceW(vector<QWORD> &vec, DWORD order, QWORD pos)
{	
	//西側に近い寺社
	return abs(pos - vec[order]);
}

QWORD getDistanceE(vector<QWORD> &vec, DWORD order, QWORD pos)
{
	QWORD distE;
	//東側に近い寺社
	if ((order == (vec.size() - 1))) {
		distE = INF;
	} else {
		distE = abs(vec[order + 1] - pos);
	}
	return distE;
}

QWORD orderComb(vector<QWORD> &vecFirst, vector<QWORD> &vecSecond, DWORD first_order, DWORD second_order, QWORD pos)
{
		QWORD ans = INF;
		QWORD tmp_ans;

		QWORD first_pos = pos;
		QWORD second_pos;

		//西→西or東
		tmp_ans = getDistanceW(vecFirst, first_order, first_pos);
		second_pos = vecFirst[first_order];
		tmp_ans += min(getDistanceE(vecSecond, second_order, second_pos), getDistanceW(vecSecond, second_order, second_pos));
		ans = min(ans, tmp_ans);	
	
		//東→西or東
		tmp_ans = getDistanceE(vecFirst, first_order, first_pos);
		if (tmp_ans != INF) {
			second_pos = vecFirst[first_order + 1];
			tmp_ans += min(getDistanceE(vecSecond, second_order, second_pos), getDistanceW(vecSecond, second_order, second_pos));
		}
		ans = min(ans, tmp_ans);
		
		return ans;
}


QWORD makeAns(U_DWORD shrine_order, U_DWORD temple_order, QWORD pos)
{
	QWORD ans = INF;
	
	QWORD first_pos = pos;
	DWORD first_order = shrine_order;
	vector<QWORD> &vecFirst = vShrine;
	
	QWORD second_pos;
	DWORD second_order = temple_order;
	vector<QWORD> &vecSecond = vTemple;

	//神社→寺
	ans = min(ans, orderComb(vShrine, vTemple, shrine_order, temple_order, pos));
	//寺→神社
	ans = min(ans, orderComb(vTemple, vShrine, temple_order, shrine_order, pos));
		
	return ans;
}

void solve(void)
{
	vector<QWORD> ::iterator itr;
	
	for (itr = vStart.begin(); itr != vStart.end(); ++itr) {
		U_DWORD shrine_order, temple_order;
			
		shrine_order = BinarySearch(vShrine, *itr);
		temple_order = BinarySearch(vTemple, *itr);

//		cout << shrine_order << "," << temple_order << endl;
		cout << makeAns(shrine_order, temple_order, *itr) << endl;
	} 


}

int main()
{
#ifdef FOR_IDE

	ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
#endif


	cin >> shrine_num >> temple_num >> start_num;

	inputInit(vShrine, shrine_num);

	inputInit(vTemple, temple_num);

	inputInit(vStart, start_num);

	solve();
	
	return 0;
}


Measured memory_bytes: 3828