#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

template<int Modulo = MOD> struct Mint {
	Int val;
	constexpr Mint(Int v = 0) noexcept : val(v% Modulo) {
		if (val < 0) v += Modulo;
	}
	constexpr int getmod() { return Modulo; }
	constexpr Mint operator - () const noexcept { return val ? Modulo - val : 0; }
	constexpr Mint operator + (const Mint& r) const noexcept { return Mint(*this) += r; }
	constexpr Mint operator - (const Mint& r) const noexcept { return Mint(*this) -= r; }
	constexpr Mint operator * (const Mint& r) const noexcept { return Mint(*this) *= r; }
	constexpr Mint operator / (const Mint& r) const noexcept { return Mint(*this) /= r; }
	constexpr Mint& operator += (const Mint& r) noexcept {
		val += r.val;
		if (val >= Modulo) val -= Modulo;
		return *this;
	}
	constexpr Mint& operator -= (const Mint& r) noexcept {
		val -= r.val;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr Mint& operator *= (const Mint& r) noexcept {
		val = val * r.val % Modulo;
		return *this;
	}
	constexpr Mint& operator /= (const Mint& r) noexcept {
		Int a = r.val, b = Modulo, u = 1, v = 0;
		while (b) {
			Int t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % Modulo;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr bool operator == (const Mint& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const Mint& r) const noexcept {
		return this->val != r.val;
	}
	friend ostream& operator << (ostream& os, const Mint<Modulo>& x) noexcept {
		return os << x.val;
	}
	friend istream& operator >> (istream& is, Mint<Modulo>& x) noexcept {
		Int tmp; is >> tmp;
		x = Mint<Modulo>(tmp);
		return is;
	}
	friend constexpr Mint<Modulo> modpow(const Mint<Modulo>& a, Int n) noexcept {
		Mint res(1), tmp = a;
		while (n > 0) {
			if (n & 1) res *= tmp;
			tmp *= tmp;
			n >>= 1;
		}
		return res;
	}
};

using mint = Mint<>;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int A, B, Q;
	cin >> A >> B >> Q;

	vector<Int> s;
	vector<Int> t;

	s.push_back(-INF);//番兵
	t.push_back(-INF);

	Int temp;
	for (Int i = 0; i < A; i++) {
		cin >> temp;
		s.push_back(temp);
	}
	s.push_back(INF);

	for (Int i = 0; i < B; i++) {
		cin >> temp;
		t.push_back(temp);
	}
	t.push_back(INF);

	//Q個のクエリ
	Int x;
	Int ans;
	Int res1, res2;
	for (Int i = 0; i < Q; i++) {
		cin >> x;
		ans = INF;

		//前方のtスタート
		res1 = t[lower_bound(t.begin(), t.end(), x) - t.begin()];
		if (res1 != INF) {
			//s（前側）
			res2 = s[lower_bound(s.begin(), s.end(), res1) - s.begin()];
			ans = min(ans, abs(res1 - x) + abs(res2 - res1));
			//s(後ろ側）
			res2 = s[lower_bound(s.begin(), s.end(), res1) - s.begin() - 1];
			ans = min(ans, abs(res1 - x) + abs(res2 - res1));
		}

		//後方のtスタート
		res1 = t[lower_bound(t.begin(), t.end(), x) - t.begin()-1];
		if (res1 != -INF) {
			//s（前側）
			res2 = s[lower_bound(s.begin(), s.end(), res1) - s.begin()];
			ans = min(ans, abs(res1 - x) + abs(res2 - res1));
			//s(後ろ側）
			Int debug = lower_bound(s.begin(), s.end(), res1) - s.begin() - 1;
			res2 = s[lower_bound(s.begin(), s.end(), res1) - s.begin() - 1];
			ans = min(ans, abs(res1 - x) + abs(res2 - res1));
		}

		//前方のsスタート
		res1 = s[lower_bound(s.begin(), s.end(), x) - s.begin()];
		if (res1 != INF) {
			//t（前側）
			res2 = t[lower_bound(t.begin(), t.end(), res1) - t.begin()];
			ans = min(ans, abs(res1 - x) + abs(res2 - res1));
			//t(後ろ側）
			res2 = t[lower_bound(t.begin(), t.end(), res1) - t.begin() - 1];
			ans = min(ans, abs(res1 - x) + abs(res2 - res1));
		}

		//後方のsスタート
		res1 = s[lower_bound(s.begin(), s.end(), x) - s.begin()-1];
		if (res1 != -INF) {
			//t（前側）
			res2 = t[lower_bound(t.begin(), t.end(), res1) - t.begin()];
			ans = min(ans, abs(res1 - x) + abs(res2 - res1));
			//t(後ろ側）
			res2 = t[lower_bound(t.begin(), t.end(), res1) - t.begin() - 1];
			ans = min(ans, abs(res1 - x) + abs(res2 - res1));
		}

		cout << ans << "\n";

	}


}

Measured memory_bytes: 3060