import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.array;
import std.math;

void main() {
	auto data = split(readln());
	auto A = to!long( data[0] ), B = to!long( data[1] ), Q = to!long( data[2] );
	long[] s, t, x;
	foreach (i; 0 .. A) { s ~= to!long( split(readln())[0] ); }
	foreach (i; 0 .. B) { t ~= to!long( split(readln())[0] ); }
	foreach (i; 0 .. Q) { x ~= to!long( split(readln())[0] ); }
	
	// temple <-> shrine minimum distance
	long[] st_d, ts_d;
	foreach (s_x; s) { st_d ~= map!(a => (a - s_x).abs())(t).array().minElement(); }
	foreach (t_x; t) { ts_d ~= map!(a => (a - t_x).abs())(s).array().minElement(); }
	
	foreach (i; 0 .. Q) {
		// x -> shrine -> temple
		long d_st;
		if (x[i] < s[0]) {
			//writeln("#st", s[0]-x[i], ", ", st_d[0]);
			d_st = s[0] - x[i] + st_d[0];
		}
		else if ( s[$-1] < x[i]) {
			//writeln("#st", x[i] - s[$-1], ", ", st_d[$-1]);
			d_st = x[i] - s[$-1] + st_d[$-1];
		}
		else foreach (cnt; 0 .. A-1) {
			if (s[cnt] < x[i] && x[i] < s[cnt+1]) {
				//writeln("#st", s[cnt+1] - x[i], ", ", st_d[cnt+1], ", ", x[i] - s[cnt], ", ", st_d[cnt]);
				d_st = min( s[cnt+1] - x[i] + st_d[cnt+1], x[i] - s[cnt] + st_d[cnt] );
				break;
			}
		}
		
		// x -> temple -> shrine
		long d_ts;
		if (x[i] < t[0]) {
			//writeln("#ts", t[0]-x[i], ", ", ts_d[0]);
			d_ts = t[0] - x[i] + ts_d[0];
		}
		else if ( t[$-1] < x[i]) {
			//writeln("#ts", x[i] - t[$-1], ", ", ts_d[$-1]);
			d_ts = x[i] - t[$-1] + ts_d[$-1];
		}
		else foreach (cnt; 0 .. A-1) {
			if (t[cnt] < x[i] && x[i] < t[cnt+1]) {
				//writeln("#ts", t[cnt+1] - x[i], ", ", ts_d[cnt+1], ", ", x[i] - t[cnt], ", ", ts_d[cnt]);
				d_ts = min( t[cnt+1] - x[i] + ts_d[cnt+1], x[i] - t[cnt] + ts_d[cnt] );
				break;
			}
		}
		
		writeln( min(d_st, d_ts) );
	}
	
}