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

int main() {
	int a, b, q;	cin >> a >> b >> q;
	vector<LL> s(a + 2), t(b + 2), x(q);
	s[0] = -1e11;	s[a + 1] = 1e11;
	t[0] = -1e11;	t[b + 1] = 1e11;

	for (int i = 1; i <= a; i++) {
		cin >> s[i];
	}
	for (int i = 1; i <= b; i++) {
		cin >> t[i];
	}
	for (int i = 0; i < q; i++) {
		cin >> x[i];
	}

	for (auto pos : x){
		LL ans = 1e11;
		auto s_itr = lower_bound(s.begin(), s.end(), pos);
		auto t_itr = lower_bound(t.begin(), t.end(), pos);
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				LL dist1 = abs(*(s_itr - i) - pos) + abs(*(s_itr - i) - *(t_itr - j));
				LL dist2 = abs(*(t_itr - j) - pos) + abs(*(s_itr - i) - *(t_itr - j));
				ans = min({ ans, dist1, dist2 });
			}
		}

		cout << ans << endl;
	}
}
