'use strict'

class Main {
  solve() {
    const nums = input.nextIntArr();
    const sLine = input.nextIntLine(nums[0]);
    const tLine = input.nextIntLine(nums[1]);
    const xLine = input.nextIntLine(nums[2]);
    const largeNumber = 1e12;
    sLine[-1] = (-largeNumber);
    tLine[-1] = (-largeNumber);
    sLine.push(largeNumber);
	tLine.push(largeNumber);
	console.log(xLine.map((x) => {
	  const si = _.binarySearch(sLine,x);
	  const ti = _.binarySearch(tLine,x);
	  const minS = Math.min(x - sLine[si-1], sLine[si] - x);
	  const minT = Math.min(x - tLine[ti - 1], tLine[ti] - x);
      const len3 = minS + minT + Math.min(minS,minT);
	  return Math.min(Math.max(x - sLine[si-1], x - tLine[ti-1]), Math.max(sLine[si] - x,tLine[ti] - x), len3);
	}).join('\n'));
  }
}

class Input {
  constructor() {
	this.cursor = 0;
	this.inputAll();
  }

  inputAll() {
	this.data = (require("fs").readFileSync("/dev/stdin", "utf8")).split('\n');
	return this.data;
  }

  nextLine(n) {
	if (n) {
	  const ret = this.data.slice(this.cursor, this.cursor + n);
	  this.cursor += n;
	  return ret;
	}
	return this.data[this.cursor++];
  }

  nextStrArr() {
	return this.nextLine().split(' ');
  }

  nextIntArr() {
	return this.nextStrArr().map((e) => parseInt(e));
  }

  nextFloatArr() {
	return this.nextStrArr().map((e) => parseFloat(e));
  }

  nextIntLine(n) {
	return this.nextLine(n).map((e) => parseInt(e))
  }

  nextFloatLine(n) {
	return this.nextLine(n).map((e) => parseFloat(e))
  }

  nextStrRange(n) {
	return this.nextLine(n).map((line) => line.split(' '));
  }

  nextIntRange(n) {
	return this.nextLine(n).map((line) => line.split(' ').map((e) => parseInt(e)));
  }

  nextFloatRange(n) {
	return this.nextLine(n).map((line) => line.split(' ').map((e) => parseFloat(e)));
  }
}

/* Underscore.js の移植および便利メソッド群 */
class Underscore {
  sum(arr) { return arr.reduce((a,b)=>a+b,0); }
  min(arr, func) { return arr.reduce((a,b) => func(a,b) < 0 ? a : b); }
  max(arr, func) { return arr.reduce((a,b) => func(a,b) > 0 ? a : b); }

  range(start, stop, step) {
	if (stop == null) {
	  stop = start || 0;
	  start = 0;
	}
	if (!step) {
	  step = stop < start ? -1 : 1;
	}
	const length = Math.max(Math.ceil((stop - start) / step), 0);
	const range = Array(length);

	for (var idx = 0; idx < length; idx++, start += step) {
	  range[idx] = start;
	}
	return range;
  }
  // Array
  initial (array, n, guard) { return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); }

  tail(arr, n, guard) { return slice.call(arr, n == null || guard ? 1 : n); }

  last (array, n, guard) {
	if (array == null || array.length < 1) return n == null ? void 0 : [];
	if (n == null || guard) return array[array.length - 1];
	return this.tail(array, Math.max(0, array.length - n));
  }

  binarySearch (array, obj, iteratee) {
	const itr = (obj) => (typeof obj === 'object') ? obj[iteratee] : obj;
	const value = itr(obj);
	let low = 0, high = array.length;
	while (low < high) {
	  let mid = Math.floor((low + high) / 2);
	  if (itr(array[mid]) < value) low = mid + 1; else high = mid;
	}
	return low;
  };
}

const _ = new Underscore();
const input = new Input();
(new Main()).solve();
