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

long long a,b,q;
long long A[100002],B[100002],Q[100000],Q2[100000];
map<long long, long long> M;

int main(){
	cin>>a>>b>>q;
	for(int i=1;i<=a;i++){
		cin>>A[i];
	}
	for(int i=1;i<=b;i++){
		cin>>B[i];
	}
	for(int i=0;i<q;i++){
		cin>>Q[i];
		Q2[i]=Q[i];
	}
	sort(Q,Q+q);
	long long x;
	A[0]=-10000000000;
	B[0]=-10000000000;
	A[a+1]=20000000000;
	B[b+1]=20000000000;
	int ss=0,se=0,ts=0,te=0,y=0;
	int qq=q;
	while(q--){
		x=Q[y];
		y++;
		long long ans=20000000000;
		while(A[ss]<x){
			ss++;
		}
		se=ss;
		ss--;
		while(B[ts]<x){
			ts++;
		}
		te=ts;
		ts--;
		//cout<<ss<<" "<<se<<" "<<ts<<" "<<te<<endl;
		ans=min(ans,x-min(A[ss],B[ts]));
		ans=min(ans,max(A[se],B[te])-x);
		ans=min(ans,B[te]-A[ss]+min(B[te]-x,x-A[ss]));
		ans=min(ans,A[se]-B[ts]+min(A[se]-x,x-B[ts]));
		M[x]=ans;
	}
	for(int i=0;i<qq;i++){
		cout<<M[Q2[i]]<<endl;
	}
}