#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = pow(10,11);

int main()
{
	ll A,B,Q;
  cin >> A >> B >> Q;
	vector<ll> s(A+2,INF),t(B+2,INF);
	s[0] = t[0] = -INF;
	s[A+1] = t[B+1] = INF;
	for (ll i(1);i<=A;++i){
		cin >> s[i];
	}
	for (ll i(1);i<=B;++i){
		cin >> t[i];
	}
	ll x;
	for (ll i(0);i<Q;++i){
		cin >> x;
		ll b = upper_bound(s.begin(),s.end(),x) - s.begin();
		ll d = upper_bound(t.begin(),t.end(),x) - t.begin();
		vector<ll> res(8);
		res[0] = abs(s[b-1]-x) + abs(s[b-1]-t[d-1]);
		res[1] = abs(t[d-1]-x) + abs(t[d-1]-s[b-1]);
		res[2] = abs(s[b-1]-x) + abs(s[b-1]-t[d]);
		res[3] = abs(t[d]-x) + abs(t[d]-s[b-1]);
		res[4] = abs(s[b]-x) + abs(s[b]-t[d-1]);
		res[5] = abs(t[d-1]-x) + abs(t[d-1]-s[b]);
		res[6] = abs(s[b]-x) + abs(s[b]-t[d]);
		res[7] = abs(t[d]-x) + abs(t[d]-s[b]);
		sort(res.begin(),res.end());
		cout << res[0] << endl;
	}
	return 0;
}