#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cstdio>
#define repp(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define repm(i,a,b) for(int i=(int)a;i>(int)b;--i)
using ll=long long;
static const ll mod = 1e9;
using namespace std;
const ll INF = 1 << 30;
int main() {
	int a, b, q;
	scanf_s("%d %d %d", &a, &b, &q);
	vector<ll>s(a), t(b), x(q);
	repp(i, 0, a)scanf_s("%jd", &s[i]);
	repp(i, 0,b)scanf_s("%jd", &t[i]);
	repp(i, 0, q)scanf_s("%jd",&x[i]);
	vector<ll>minv(q);
	repp(i, 0,q) {
		auto pos_sr = s.begin(), pos_tr = t.begin(), pos_sl = s.begin(), pos_tl = t.begin();//iteratorを書くと煩雑になるのでautoを使っている
		s.insert(s.begin(), -INF); t.insert(t.begin(), -INF);
		s.push_back(INF); t.push_back(INF);
		pos_sr=lower_bound(s.begin(), s.end(), x[i]);
		pos_tr = lower_bound(t.begin(), t.end(), x[i]);
		pos_sl = pos_sr - 1;
		pos_tl = pos_tr - 1;
		ll d1 = abs(*pos_sr - x[i]), d2 = abs(*pos_sl - x[i]);
		ll d3 = abs(*pos_tr - x[i]), d4 = abs(*pos_tl - x[i]);
		minv[i] = min({ d1 + abs(*pos_tr - *pos_sr),d1 + abs(*pos_tl - *pos_sr),d2 + abs(*pos_tr - *pos_sl),d2 + abs(*pos_tl - *pos_sl),d3 + abs(*pos_sl - *pos_tr),d3 + abs(*pos_sr - *pos_tr),d4 + abs(*pos_sl - *pos_tl),d4 + abs(*pos_sr - *pos_tl) });
	}
	repp(i, 0, q)printf("%jd\n", minv[i]);
	return 0;
}