'use strict'
//デバッグのためお借りしています。
var GET=(function(){
  function f(s){return new g(s);}
  function g(s){
    this._s=s.trim().split("\n");
    this._y=0;
  }
  g.prototype.a=function(f){
    var s=this._s, y=this._y, r;
    if(typeof s[y]==="string")
      s[y]=s[y].split(" ").reverse();
    r=s[y].pop();
    if(!s[y].length)
      this._y++;
    return f?r:+r;
  };
  g.prototype.l=function(f){
    var s=this._s[this._y++].split(" ");
    return f?s:s.map(a=>+a);
  };
  g.prototype.r=function(n,f){
    var r=this._s.slice(this._y,this._y+=n);
    return f?r:r.map(a=>+a);
  };
  return f;
})();

var o=new GET(require('fs').readFileSync('/dev/stdin','utf8'));

function main(){
  var a = o.a();
  var b = o.a();
  var q = o.a();
  var s = [-9e15].concat(o.r(a));
  var t = [-9e15].concat(o.r(b));
  var x = o.r(q);
  var x2 = Array(q);
  var xs = 0, xt = 0;
  var ans = Array(q);
  for(var i = 0; i < q; i++){
    x2[i] = [x[i], i];
  }
  x2.sort((a,b)=>a[0]-b[0]);
  for(i = 0; i < q; i++){
    var z = x2[i][0];
    var u = 9e99, v;
    while(xs <= a && s[xs] < z)xs++;
    while(xt <= b && t[xt] < z)xt++;
    if(xs > 1 && xt > 1){
      v = z - Math.min(s[xs-1], t[xt-1]);
      if(v < u)u = v;
    }
    if(xt > 1 && xs !== a+1){
      v = Math.min(z + s[xs] - 2 * t[xt-1], 2 * s[xs] - z - t[xt-1]);
      if(v < u)u = v;
    }
    if(xs !== a+1 && xt !== b+1){
      v = Math.max(s[xs], t[xt]) - z;
      if(v < u)u = v;  
    }
    if(xs > 1 && xt !== b+1){
      v = Math.min(z + t[xt] - 2 * s[xs-1], 2 * t[xt] - z - s[xs-1]);
      if(v < u)u = v;  
    }
    ans[x2[i][1]] = u;
  }
  return ans.join("\n");
}
var hisAns=main();
  console.log(hisAns);