//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <iostream>
#include <limits>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = long long;
using ull = unsigned long long;

template<typename Monoid>
struct SegmentTree {
	using Op = function<Monoid(const Monoid& lhs, const Monoid& rhs)>;
	size_t width;
	vector<Monoid> node;
	Op op;
	Monoid unit;

	SegmentTree(const vector<Monoid>& elems, Op op, Monoid unit)
	: op(op)
	, unit(unit) {
		width = 1;
		while (width < elems.size()) {
			width *= 2;
		}
		node.resize(2 * width - 1, unit);
		for (size_t i = 0; i < elems.size(); i++) {
			node[i + width - 1] = elems[i];
		}
		for (size_t i = width - 2; i != numeric_limits<size_t>::max(); i--) {
			node[i] = op(node[2 * i + 1], node[2 * i + 2]);
		}
	}
	void update(size_t idx, Monoid elem) {
		idx += width - 1;
		node[idx] = elem;
		while (idx >= 1) {
			idx = (idx - 1) / 2;
			node[idx] = op(node[2 * idx + 1], node[2 * idx + 2]);
		}
	}
	Monoid query(size_t a, size_t b, size_t root) const {
		assert(0 <= a && b <= width);
		size_t left = root, right = root;
		while (left < width - 1) {
			left = 2 * left + 1;
		}
		left -= (width - 1);
		while (right < width - 1) {
			right = 2 * right + 2;
		}
		right -= (width - 1);
		right++;
		if (right <= a || b <= left) {
			return unit;
		}
		if (a <= left && right <= b) {
			return node[root];
		}
		Monoid ans_l = query(a, b, 2 * root + 1);
		Monoid ans_r = query(a, b, 2 * root + 2);
		return op(ans_l, ans_r);
	}
};

int main() {
	int A, B, Q;
	cin >> A >> B >> Q;
	struct PointInfo {
		ll pos;
		ll length_to_neighbour;
	};
	vector<PointInfo> shrines;
	vector<PointInfo> temples;
	for (int i = 0; i < A; i++) {
		ll pos;
		cin >> pos;
		shrines.push_back(PointInfo{pos, numeric_limits<ll>::max()});
	}
	for (int i = 0; i < B; i++) {
		ll pos;
		cin >> pos;
		temples.push_back(PointInfo{pos, numeric_limits<ll>::max()});
	}
	sort(shrines.begin(), shrines.end(),
		 [](PointInfo lhs, PointInfo rhs) { return lhs.pos < rhs.pos; });
	sort(temples.begin(), temples.end(),
		 [](PointInfo lhs, PointInfo rhs) { return lhs.pos < rhs.pos; });
	int cnt = 0;
	while (cnt < 2) {
		vector<PointInfo>* this_points = nullptr;
		vector<PointInfo>* that_points = nullptr;
		if (cnt == 0) {
			this_points = &shrines;
			that_points = &temples;
		} else {
			this_points = &temples;
			that_points = &shrines;
		}
		for (PointInfo& sh : *this_points) {
			auto first_it = partition_point(that_points->begin(),
											that_points->end(), [&sh](PointInfo elm) {
												return elm.pos < sh.pos;
											});
			if (first_it == that_points->begin()) {
				sh.length_to_neighbour = min(sh.length_to_neighbour,
											 first_it->pos - sh.pos);
			} else if (first_it == that_points->end()) {
                auto it = prev(first_it);
				sh.length_to_neighbour = min(sh.length_to_neighbour,
											 sh.pos - it->pos);
			} else {
				sh.length_to_neighbour = min(sh.length_to_neighbour,
											 first_it->pos - sh.pos);
				sh.length_to_neighbour = min(sh.length_to_neighbour,
											 sh.pos - prev(first_it)->pos);
			}
		}
		cnt++;
	}
	vector<PointInfo> merged = move(shrines);
	copy(temples.begin(), temples.end(), back_inserter(merged));
	sort(merged.begin(), merged.end(),
		 [](PointInfo lhs, PointInfo rhs) { return lhs.pos < rhs.pos; });
	vector<ll> left_costs;
	vector<ll> right_costs;
	for (PointInfo pt : merged) {
		left_costs.push_back(-pt.pos + pt.length_to_neighbour);
		right_costs.push_back(pt.pos + pt.length_to_neighbour);
	}
	SegmentTree<ll> left_tree(left_costs,
							  [](ll lhs, ll rhs) { return min(lhs, rhs); },
							  numeric_limits<ll>::max() / 2);
	SegmentTree<ll> right_tree(right_costs,
							   [](ll lhs, ll rhs) { return min(lhs, rhs); },
							   numeric_limits<ll>::max() / 2);
	for (int i = 0; i < Q; i++) {
		ll X;
		cin >> X;
		auto first_it = partition_point(merged.begin(), merged.end(), [X](PointInfo elm) {
			return elm.pos < X;
		});
        ll left_cost = left_tree.query(0, distance(merged.begin(), first_it), 0) + X;
        ll right_cost = right_tree.query(distance(merged.begin(), first_it), merged.size(), 0) - X;
        cout << min(left_cost, right_cost) << endl;
	}
}

Measured memory_bytes: 19948