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

#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define ldb long double 
#define db double
#define int long long

#define fr first
#define se second
#define lb lower_bound 
#define ub upper_bound 
#define pb push_back
#define mpr make_pair

#define pi pair<int,int>
#define pdb pair<db,db>
#define pldb pair<ldb,ldb>

#define vi vector<int>
#define vdb vector<db>
#define vldb vector<ldb>
#define vpi vector< pi >

#define mi map<int,int>
#define mdb map<db,db>
#define mldb map<ldb,ldb>


#define forr(a,b) for (int i = (a); i < (b); ++i)
#define rrof(a,b) for (int i = (b)-1; i >= (a); --i)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

const int md = 1e9+7;
const int MX = 2e5+5;
const int INF = 1e18; 
const ldb PI = 4*atan((ldb)1);

int power_md(int a,int n)
{
 int res=1;
 while(n)
{
 if(n%2)
  res=(res%md*a%md)%md;
  a=(a%md*a%md)%md;
  n/=2;
}
res%=md;
return res;
}

int power(int a,int n)
{
 int res=1;
 while(n)
{
 if(n%2)
  res*=a;
  a=a*a;
  n/=2;
}
return res;
}

int abst(int a)
{
 return ((a<0)?(-1*a):(a));
}

class cmp_set{
public:
	bool operator() (int a, int b){
		return a > b;
	}
};

vector<string> vec_splitter(string s) {
	s += ',';
	vector<string> res;
	while(!s.empty()) {
		res.push_back(s.substr(0, s.find(',')));
		s = s.substr(s.find(',') + 1);
	}
	return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
	if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
	stringstream ss; ss << H;
	cerr << args[idx] << " = " << ss.str();
	debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif

int32_t main()
{
     fast;
    int a,b,q;
    cin>>a>>b>>q;
    vi s,t;
    for(int i=0;i<a;i++)
    {
        int x;
        cin>>x;
        s.pb(x);
    }
    for(int i=0;i<b;i++)
    {
        int x;
        cin>>x;
        t.pb(x);
    }
    while(q--)
    {
        int x;
        cin>>x;
        int ls=-1e18,rs=1e18,lt=-1e18,rt=1e18;
        auto it1=lb(s.begin(),s.end(),x);
        auto it2=lb(t.begin(),t.end(),x);
        if(it1!=s.end())
         rs=*(it1);
         if(it2!=t.end())
          rt=*(it2);
         if(it1!=s.begin())
         {
             it1--;
             ls=*(it1);
         }
         if(it2!=t.begin())
         {
             it2--;
             lt=*(it2);
         }
         int minn=1e18;
         int t1;
         if(ls!=-1e18&&lt!=-1e18)
         {
             t1=x-min(ls,lt);
             minn=min(minn,t1);
         }
         if(rs!=1e18&&rt!=1e18)
         {
             t1=max(rs,rt)-x;
             minn=min(minn,t1);
         }
         if(ls!=-1e18&&rt!=1e18)
         {
             t1=2*min((x-ls),(rt-x))+max((x-ls),(rt-x));
             minn=min(minn,t1);
         }
         if(rs!=1e18&&lt!=-1e18)
         {
             t1=2*min((x-lt),(rs-x))+max((x-lt),(rs-x));
             minn=min(minn,t1);
         }
         cout<<minn<<"\n";
    }
      return 0;
}

Measured memory_bytes: 3060