#ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <map>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;

typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

class UnionFind {
private:
	unsigned size_; 
	std::vector<unsigned> par, rank;
public:
	UnionFind() : size_(0), par(std::vector<unsigned>()), rank(std::vector<unsigned>()) {};
	UnionFind(unsigned size__) : size_(size__) {
		par.resize(size_); rank.resize(size_);
		for (unsigned i = 0; i < size_; i++) par[i] = i, rank[i] = 0;
	}
	unsigned size() { return size_; }
	//unsigned root(unsigned x) { return par[x] == x ? x : par[x] = root(par[x]); }
	unsigned root(unsigned x)
	{
		while(par[x] != x)
		{
			par[x] = par[par[x]];
			x = par[x];
		}
		return x;
	}
	bool same(unsigned x, unsigned y) { return root(x) == root(y); }
	void unite(unsigned x, unsigned y) {
		x = root(x), y = root(y);
		if (x == y) return;
		if (rank[x] < rank[y]) par[x] = y;
		else if (rank[x] == rank[y]) par[y] = x, rank[x]++;
		else par[y] = x;
	}
	bool operator==(const UnionFind &u) { return par == u.par; }
	bool operator!=(const UnionFind &u) { return par != u.par; }
};

/*
maybe sth wrong 
got wa in one problem
*/
ll modpow(ll a, ll b)
{
	if (b == 0)
	{
		return 1;
	}

	if (b % 2)
	{
		return a * modpow(a, b-1) % MOD;
	}
	else
	{
		ll halfB = b / 2;
		ll half = modpow(a, halfB);
		return half * half % MOD;
	}
}

ll calcComb(ll n, ll m)
{
	if (m > n-m)
	{
		return calcComb(n, n-m);
	}

	ll ansMul = 1;
	ll ansDiv = 1;

	rep(i, m)
	{
		ansMul *= (n-i);
		ansDiv *= (i+1);
		ansMul %= MOD;
		ansDiv %= MOD;
	}

	return ansMul * modpow(ansDiv, MOD - 2) % MOD;
}

__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}


int main()
{
	int A, B, Q;
	
	cin >> A >> B >> Q;

	ll s[A], t[B];
	ll total[A+B];
	rep(i, A)
	{
		cin >> s[i];
		total[i] = s[i];
	}

	map<ll, ll> mapping;

	rep(i, B)
	{
		cin >> t[i];
		total[i+A] = t[i];
		ll l = 0, r = A - 1;
		
		while(l < r)
		{
			ll mid = l + ((r - l) >> 1);
			if (t[i] > s[mid])
			{
				l = mid + 1;
			}
			else
			{
				r = mid - 1;
			}
		}

		//cout <<"1=="<< "l = " << l << "; r = " << r << endl;

		ll tmp1 = (l-1>=0) ? (abs(t[i] - s[l-1])) : LLONG_MAX;
		ll tmp2 = abs(t[i] - s[l]);
		ll tmp3 = (l+1 < A) ? (abs(t[i] - s[l+1])) : LLONG_MAX;
		//cout <<"1=="<< tmp1 << ";" << tmp2 << "; r = " << tmp3 << endl;
		if (tmp1 < tmp2)
		{
			if (tmp1 < tmp3)
			{
				mapping[t[i]] = s[l-1];
				//mapping[s[l-1]] = t[i];
			}
			else
			{
				mapping[t[i]] = s[l + 1];
				//mapping[s[l+1]] = t[i];
			}
		}
		else
		{
			if (tmp2 < tmp3)
			{
				mapping[t[i]] = s[l];
				//mapping[s[l]] = t[i];
			}
			else
			{
				mapping[t[i]] = s[l + 1];
				//mapping[s[l+1]] = t[i];
			}
		}

	}

	rep(i, A)
	{
		ll l = 0, r = B - 1;
		
		while(l < r)
		{
			ll mid = l + ((r - l) >> 1);
			if (s[i] > t[mid])
			{
				l = mid + 1;
			}
			else
			{
				r = mid - 1;
			}
		}
		//cout <<"2=="<< "l = " << l << "; r = " << r << endl;
		ll tmp1 = (l-1 >= 0) ? (abs(s[i] - t[l-1])): LLONG_MAX;
		ll tmp2 = abs(s[i] - t[l]);
		ll tmp3 = (l+1 < B) ? (abs(s[i] - t[l+1])) : LLONG_MAX;

		if (tmp1 < tmp2)
		{
			if (tmp1 < tmp3)
			{
				mapping[s[i]] = t[l-1];
			}
			else
			{
				mapping[s[i]] = t[l + 1];
			}
		}
		else
		{
			if (tmp2 < tmp3)
			{
				mapping[s[i]] = t[l];
			}
			else
			{
				mapping[s[i]] = t[l + 1];
			}
		}
	}

	sort(total, total + (A + B));

	/*
	cout << "total st;" << endl;
	rep(i, A+B)
	{
		cout <<  total[i] << endl;
	}

	cout << "total end;" << endl;
	*/

	/*
	map<ll, ll>::iterator it = mapping.begin();
	for(; it!=mapping.end(); it++)
	{
		cout << it->first << "::" << it->second << endl;
	}
	*/

	rep(i, Q)
	{

		ll q;
		cin >> q;

		//cout << endl << "q:" << q << endl;

		ll l = 0, r = A + B - 1;
		
		while(l < r)
		{
			ll mid = l + ((r - l) >> 1);
			if (q > total[mid])
			{
				l = mid + 1;
			}
			else
			{
				r = mid - 1;
			}
		}
		//cout << "l = " << l << "; r = " << r << endl;
		ll tmp1 = (l-1>=0) ? (abs(q - total[l-1]) + abs(total[l-1] - mapping[total[l-1]])) : LLONG_MAX;
		ll tmp2 = abs(q - total[l]) + abs(total[l] - mapping[total[l]]);
		ll tmp3 = (l+1<A+B) ? (abs(q - total[l+1]) + abs(total[l+1] - mapping[total[l+1]])) : LLONG_MAX;

		if (tmp1 < tmp2)
		{
			if (tmp1 < tmp3)
			{
				//cout << total[l-1] << "; mapping = " << mapping[total[l-1]] << endl;
				//cout << tmp1 + (abs(total[l-1] - mapping[total[l-1]])) << endl;
				cout << tmp1<< endl;
			}
			else
			{
				//cout << total[l+1] << "; mapping = " << mapping[total[l+1]]  << endl;
				//cout << tmp3 + (abs(total[l+1] - mapping[total[l+1]])) << endl;
				cout << tmp3 << endl;
			}
		}
		else
		{
			if (tmp2 < tmp3)
			{
				//cout << total[l] << "; mapping = " << mapping[total[l]]  << endl;
				//cout << tmp2 + (abs(total[l] - mapping[total[l]])) << endl;
				cout << tmp2 << endl;
			}
			else
			{
				//cout << total[l+1] << "; mapping = " << mapping[total[l+1]]  << endl;
				//cout << tmp3 + (abs(total[l+1] - mapping[total[l+1]])) << endl;
				cout << tmp3 << endl;
			}
		}
	}

	
	return 0;
}


Measured memory_bytes: 16896