module.exports=function(t){var r={};function n(e){if(r[e])return r[e].exports;var i=r[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=r,n.d=function(t,r,e){n.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:e})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,r){if(1&r&&(t=n(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var i in t)n.d(e,i,function(r){return t[r]}.bind(null,i));return e},n.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(r,"a",r),r},n.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},n.p="",n(n.s=0)}([function(t,r,n){"use strict";var e=n(1);n(2)(e.readFileSync("/dev/stdin","utf8"))},function(t,r){t.exports=require("fs")},function(t,r,n){"use strict";var e=n(3),i=n(5);t.exports=function(t){var r=new e(t);i(r)}},function(t,r,n){"use strict";var e=n(4);t.exports=class{constructor(t){var r=t.trim().split(/\s+/g);this.inp=new e(r)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,r,n){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,r,n){"use strict";function e(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var n=[],e=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){i=!0,o=t}finally{try{e||null==u.return||u.return()}finally{if(i)throw o}}return n}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t,r){return null==t||null==r?9999999999999:t<=0&&r>=0||t>=0&&r<=0?2*Math.min(Math.abs(t),Math.abs(r))+Math.max(Math.abs(t),Math.abs(r)):Math.max(Math.abs(t),Math.abs(r))}function o(t,r){for(var n=-1,e=t.length;Math.abs(n-e)>1;){var i=Math.floor((n+e)/2);t[i]<=r?n=i:e=i}for(var o=-1!=n?t[n]-r:void 0,a=t.length,u=-1;Math.abs(a-u)>1;){var s=Math.floor((a+u)/2);r<=t[s]?a=s:u=s}return[o,a!=t.length?t[a]-r:void 0]}t.exports=function(t){for(var r=t.in(),n=t.in(),a=t.in(),u=new Array(r),s=0;s<r;s++)u[s]=t.in();for(var l=new Array(n),c=0;c<n;c++)l[c]=t.in();for(var f=[],h=0;h<a;h++){var d=t.in(),p=e(o(u,d),2),v=p[0],b=p[1],y=e(o(l,d),2),m=y[0],M=y[1],g=i(b,M),x=i(b,m),j=i(v,M),w=i(v,m);f.push(Math.min(g,x,j,w))}console.log(f.join("\n"))}}]);
