#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, n) for(int i = 1; i <= (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll INF=pow(10,18);
const double inf=pow(10,10);
const ld pi=acosl(1);
const ll mod = 1000000007;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};

void solve(){
	ll a,b,q;cin>>a>>b>>q;
	vector<ll>s(a);
	vector<ll>t(b);
	rep(i,a)cin>>s[i];
	rep(i,b)cin>>t[i];
	s.push_back(INF);
	t.push_back(INF);
	s.push_back(INF);
	t.push_back(INF);
	s.push_back(INF);
	t.push_back(INF);
	s.push_back(-INF);
	t.push_back(-INF);
	s.push_back(-INF);
	t.push_back(-INF);
	sort(all(s));
	sort(all(t));
	rep(qq,q){
		ll x;cin>>x;
		ll ans=INF;
		auto itr=lower_bound(all(s),x);
		ll x1=*itr;
		ll x2=*(itr-1);
		ll x3=*(itr+1);
		itr=lower_bound(all(t),x1);
		ans=min(ans,abs(x-x1)+abs(x1-*itr));
		ans=min(ans,abs(x-x1)+abs(x1-*(itr-1)));
		ans=min(ans,abs(x-x1)+abs(x1-*(itr+1)));
		itr=lower_bound(all(t),x2);
		ans=min(ans,abs(x-x2)+abs(x2-*itr));
		ans=min(ans,abs(x-x2)+abs(x2-*(itr-1)));
		ans=min(ans,abs(x-x2)+abs(x2-*(itr+1)));
		itr=lower_bound(all(t),x3);
		ans=min(ans,abs(x-x3)+abs(x3-*itr));
		ans=min(ans,abs(x-x3)+abs(x3-*(itr-1)));
		ans=min(ans,abs(x-x3)+abs(x3-*(itr+1)));
		
		itr=lower_bound(all(t),x);
		x1=*itr;
		x2=*(itr-1);
		x3=*(itr+1);
		itr=lower_bound(all(s),x1);
		ans=min(ans,abs(x-x1)+abs(x1-*itr));
		ans=min(ans,abs(x-x1)+abs(x1-*(itr-1)));
		ans=min(ans,abs(x-x1)+abs(x1-*(itr+1)));
		itr=lower_bound(all(s),x2);
		ans=min(ans,abs(x-x2)+abs(x2-*itr));
		ans=min(ans,abs(x-x2)+abs(x2-*(itr-1)));
		ans=min(ans,abs(x-x2)+abs(x2-*(itr+1)));
		itr=lower_bound(all(s),x3);
		ans=min(ans,abs(x-x3)+abs(x3-*itr));
		ans=min(ans,abs(x-x3)+abs(x3-*(itr-1)));
		ans=min(ans,abs(x-x3)+abs(x3-*(itr+1)));
		
		cout<<ans<<endl;
	}
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout<<fixed;
	cout<<setprecision(30);
	solve();
}


Measured memory_bytes: 2912