// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please



const int cm = 1 << 17;

char cn[cm], * ci = cn + cm, ct;

inline char getcha() {

	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }

	return *ci++;

}

inline ll getint() {

	ll A = 0;

	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';

	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';

	return A;

}



const int dm = 1 << 21;

char dn[dm], * di = dn;

inline void putint(ll X) {

	if (X == 0) {

		*di++ = '0';

		*di++ = '\n';

		return;

	}

	int keta = 0;

	char C[15];

	while (X) {

		*(C + keta) = '0' + X % 10;

		X /= 10;

		keta++;

	}

	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));

	*di++ = '\n';

}



int main() {





	int A = getint(), B = getint(), Q = getint();

	ll s[100100], t[100100];

	s[0] = -1e12;

	t[0] = -1e12;

	s[A + 1] = 1e12;

	t[B + 1] = 1e12;

	rep1(i, A) s[i] = getint();

	rep1(i, B) t[i] = getint();



	rep(i, Q) {

		ll x = getint();



		auto sp = lower_bound(s, s + A + 2, x);

		ll s1 = *(sp - 1);

		ll s2 = *sp;

		auto tp = lower_bound(t, t + B + 2, x);

		ll t1 = *(tp - 1);

		ll t2 = *tp;



		ll saishou = 1e13;

		saishou = min(saishou, abs(min(s1, t1) - x));

		saishou = min(saishou, abs(max(s2, t2) - x));

		ll k1 = abs(s1 - x);

		ll k2 = abs(t2 - x);

		saishou = min(saishou, k1 + k2 + min(k1, k2));

		ll k3 = abs(t1 - x);

		ll k4 = abs(s2 - x);

		saishou = min(saishou, k3 + k4 + min(k3, k4));



		putint(saishou);

	}



	fwrite_unlocked(dn, di - dn, 1, stdout);



	Would you please return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.661421688054566x):
//#include<bits/stdc++.h>

#include<cstdio>

#include<algorithm>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please



const int cm = 1 << 17;

char cn[cm], * ci = cn + cm, ct;

inline char getcha() {

	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }

	return *ci++;

}

inline ll getint() {

	ll A = 0;

	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';

	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';

	return A;

}



const int dm = 1 << 21;

char dn[dm], * di = dn;

inline void putint(ll X) {

	if (X == 0) {

		*di++ = '0';

		*di++ = '\n';

		return;

	}

	int keta = 0;

	char C[15];

	while (X) {

		*(C + keta) = '0' + X % 10;

		X /= 10;

		keta++;

	}

	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));

	*di++ = '\n';

}



void pakuri_sort(int N, ll A[]) {

	const int b = 8;

	ll tmp[100001];

	rep(k, 8) {

		int kazu[1 << b] = {}, kazu2[1 << b] = {};

		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;

		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];

		for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];

		k++;

		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;

		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];

		for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];

	}

}



int main() {





	int A = getint(), B = getint(), Q = getint();

	ll s[100100], t[100100];

	s[0] = -1e12;

	t[0] = -1e12;

	s[A + 1] = 1e12;

	t[B + 1] = 1e12;

	rep1(i, A) s[i] = getint();

	rep1(i, B) t[i] = getint();



	ll X[100000];

	rep(i, Q) {

		X[i] = (getint() << 20) + i;

	}

	pakuri_sort(Q, X);



	int ks = 0, kt = 0;

	ll kotae[100000];

	rep(i, Q) {

		ll x = X[i] >> 20;

		while (s[ks] < x) ks++;

		while (t[kt] < x) kt++;



		ll s1 = s[ks - 1];

		ll s2 = s[ks];

		ll t1 = t[kt - 1];

		ll t2 = t[kt];



		ll saishou = 1e13;

		saishou = min(saishou, abs(min(s1, t1) - x));

		saishou = min(saishou, abs(max(s2, t2) - x));

		ll k1 = abs(s1 - x);

		ll k2 = abs(t2 - x);

		saishou = min(saishou, k1 + k2 + min(k1, k2));

		ll k3 = abs(t1 - x);

		ll k4 = abs(s2 - x);

		saishou = min(saishou, k3 + k4 + min(k3, k4));



		kotae[X[i] & (1 << 20) - 1] = saishou;

	}



	rep(i, Q) putint(kotae[i]);



	fwrite_unlocked(dn, di - dn, 1, stdout);



	Would you please return 0;

}