#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int lim = 1e5+5;

ll shr[lim],tem[lim];
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
		
	int a,b,q;
	cin>>a>>b>>q;
	for(int i=0;i<a;++i)
		cin>>shr[i];
	for(int i=0;i<b;++i)
		cin>>tem[i];
	sort(shr,shr+a);
	sort(tem,tem+b);
	for(int i=0;i<q;++i)
	{
		ll x;
		cin>>x;
		int s2 = upper_bound(shr,shr+a,x)-shr,t2 = upper_bound(tem,tem+b,x) - tem;
		int s1 = s2-1,t1 = t2-1;

		ll ans = 2e18;
		vector<ll> use1,use2;
		if(s1>=0)
			use1.push_back(shr[s1]);
		if(s2<a)
			use1.push_back(shr[s2]);
		if(t1>=0)
			use2.push_back(tem[t1]);
		if(t2<b)
			use2.push_back(tem[t2]);

		for(int i=0;i<use1.size();++i)
			for(int j=0;j<use2.size();++j)
				ans = min(ans,min( abs(x-use1[i])+abs(use1[i]-use2[j]),abs(x-use2[j])+abs(use1[i]-use2[j])));
		cout<<ans<<'\n';
	}

    return 0;
}