#include"bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define fi first 
#define se second
const long long MOD = 1000000007;
const long long inf = 1ll << 61;
const double eps = 0.000000000001;
typedef long long ll;
struct edge { int to; int cost; int color; };
int s[100006], t[100006], r[100006];

signed main() {
	int a, b, q; cin >> a >> b >> q;
	rep(i, a)cin >> s[i+1];
	rep(i, b)cin >> t[i+1];
	s[0] = t[0] = -inf;
	s[a + 1] = inf; t[b + 1] = inf;
	rep(i, q) {
		cin >> r[i];
		int S[3], T[3];
		S[0] = *(upper_bound(s, s + a + 2, r[i]) - 1);
		S[1] = *lower_bound(s, s + a + 2, r[i]);
		T[0] = *(upper_bound(t, t + b + 2, r[i]) - 1);
		T[1] = *lower_bound(t, t + b + 2, r[i]);
		int ans = inf;
		rep(j, 2) {
			rep(k, 2) {
				ans = min(ans, abs(S[j] - T[k]) + min(abs(r[i] - S[j]), abs(r[i] - T[k])));
			}
		}

		cout << ans<< endl;
	}
}
