#include <bits/stdc++.h>
#define INF 999999999999
using namespace std;

typedef long long ll;

int main(){
	ll a, b, q;
	cin >> a >> b >> q;
	vector<ll> s(a);
	for(ll i = 0; i < a; i++)cin >> s[i];
	vector<ll> t(b);
	for(ll i = 0; i < b; i++)cin >> t[i];
	for(int i = 0; i < q; i++){
		ll x;
		cin >> x;
		ll s1, s2, t1, t2;
		auto itr1 = lower_bound(s.begin(), s.end(), x);
		if(!(s.end()-itr1)){
			s2 = INF;
			s1 = s[a-1];
		}else{
			s2 = *itr1;
			itr1--;
			if(itr1-s.begin()+1)s1 = *itr1;
			else s1 = -INF;
		}
		auto itr2 = lower_bound(t.begin(), t.end(), x);
		if(!(t.end()-itr2)){
			t2 = INF;
			t1 = t[b-1];
		}else{
			t2 = *itr2;
			itr2--;
			if(itr2-t.begin()+1)t1 = *itr2;
			else t1 = -INF;
		}
		ll ans = INF;
		ans = min(ans, t2-s1+min(t2-x, x-s1));
		ans = min(ans, s2-t1+min(s2-x, x-t1));
		ans = min(ans, max(t2, s2)-x);
		ans = min(ans, x-min(s1, t1));
		cout << ans << endl;
	}
    return 0;
}