module.exports=function(t){var r={};function n(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in t)n.d(e,o,function(r){return t[r]}.bind(null,o));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),o=n(7);t.exports=function(t){var r=new e(t);o(r)}},function(t,r,n){"use strict";var e=n(4).resolve(),o=n(6)(e+"/src/jslib/QueueF");t.exports=class{constructor(t){var r=t.trim().split(/\s+/g);this.inp=new o(r)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,r,n){(function(t){function n(t,r){for(var n=0,e=t.length-1;e>=0;e--){var o=t[e];"."===o?t.splice(e,1):".."===o?(t.splice(e,1),n++):n&&(t.splice(e,1),n--)}if(r)for(;n--;n)t.unshift("..");return t}function e(t,r){if(t.filter)return t.filter(r);for(var n=[],e=0;e<t.length;e++)r(t[e],e,t)&&n.push(t[e]);return n}r.resolve=function(){for(var r="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var u=i>=0?arguments[i]:t.cwd();if("string"!=typeof u)throw new TypeError("Arguments to path.resolve must be strings");u&&(r=u+"/"+r,o="/"===u.charAt(0))}return(o?"/":"")+(r=n(e(r.split("/"),function(t){return!!t}),!o).join("/"))||"."},r.normalize=function(t){var i=r.isAbsolute(t),u="/"===o(t,-1);return(t=n(e(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&u&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(e(t,function(t,r){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,n){function e(t){for(var r=0;r<t.length&&""===t[r];r++);for(var n=t.length-1;n>=0&&""===t[n];n--);return r>n?[]:t.slice(r,n-r+1)}t=r.resolve(t).substr(1),n=r.resolve(n).substr(1);for(var o=e(t.split("/")),i=e(n.split("/")),u=Math.min(o.length,i.length),a=u,s=0;s<u;s++)if(o[s]!==i[s]){a=s;break}var c=[];for(s=a;s<o.length;s++)c.push("..");return(c=c.concat(i.slice(a))).join("/")},r.sep="/",r.delimiter=":",r.dirname=function(t){if("string"!=typeof t&&(t+=""),0===t.length)return".";for(var r=t.charCodeAt(0),n=47===r,e=-1,o=!0,i=t.length-1;i>=1;--i)if(47===(r=t.charCodeAt(i))){if(!o){e=i;break}}else o=!1;return-1===e?n?"/":".":n&&1===e?"/":t.slice(0,e)},r.basename=function(t,r){var n=function(t){"string"!=typeof t&&(t+="");var r,n=0,e=-1,o=!0;for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!o){n=r+1;break}}else-1===e&&(o=!1,e=r+1);return-1===e?"":t.slice(n,e)}(t);return r&&n.substr(-1*r.length)===r&&(n=n.substr(0,n.length-r.length)),n},r.extname=function(t){"string"!=typeof t&&(t+="");for(var r=-1,n=0,e=-1,o=!0,i=0,u=t.length-1;u>=0;--u){var a=t.charCodeAt(u);if(47!==a)-1===e&&(o=!1,e=u+1),46===a?-1===r?r=u:1!==i&&(i=1):-1!==r&&(i=-1);else if(!o){n=u+1;break}}return-1===r||-1===e||0===i||1===i&&r===e-1&&r===n+1?"":t.slice(r,e)};var o="b"==="ab".substr(-1)?function(t,r,n){return t.substr(r,n)}:function(t,r,n){return r<0&&(r=t.length+r),t.substr(r,n)}}).call(this,n(5))},function(t,r){var n,e,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(r){try{return n.call(null,t,0)}catch(r){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{e="function"==typeof clearTimeout?clearTimeout:u}catch(t){e=u}}();var s,c=[],f=!1,l=-1;function h(){f&&s&&(f=!1,s.length?c=s.concat(c):l=-1,c.length&&p())}function p(){if(!f){var t=a(h);f=!0;for(var r=c.length;r;){for(s=c,c=[];++l<r;)s&&s[l].run();l=-1,r=c.length}s=null,f=!1,function(t){if(e===clearTimeout)return clearTimeout(t);if((e===u||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{e(t)}catch(r){try{return e.call(null,t)}catch(r){return e.call(this,t)}}}(t)}}function v(t,r){this.fun=t,this.array=r}function d(){}o.nextTick=function(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];c.push(new v(t,r)),1!==c.length||f||a(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=d,o.addListener=d,o.once=d,o.off=d,o.removeListener=d,o.removeAllListeners=d,o.emit=d,o.prependListener=d,o.prependOnceListener=d,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,r){function n(t){var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=6},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,o=!1,i=void 0;try{for(var u,a=t[Symbol.iterator]();!(e=(u=a.next()).done)&&(n.push(u.value),!r||n.length!==r);e=!0);}catch(t){o=!0,i=t}finally{try{e||null==a.return||a.return()}finally{if(o)throw i}}return n}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(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 i(t,r){for(var n=-1,e=t.length;Math.abs(n-e)>1;){var o=Math.floor((n+e)/2);t[o]<=r?n=o:e=o}for(var i=-1!=n?t[n]-r:void 0,u=t.length,a=-1;Math.abs(u-a)>1;){var s=Math.floor((u+a)/2);r<=t[s]?u=s:a=s}return[i,u!=t.length?t[u]-r:void 0]}t.exports=function(t){for(var r=t.in(),n=t.in(),u=t.in(),a=new Array(r),s=0;s<r;s++)a[s]=t.in();for(var c=new Array(n),f=0;f<n;f++)c[f]=t.in();for(var l=[],h=0;h<u;h++){var p=t.in(),v=e(i(a,p),2),d=v[0],b=v[1],g=e(i(c,p),2),m=g[0],y=g[1],w=o(b,y),T=o(b,m),M=o(d,y),x=o(d,m);l.push(Math.min(w,T,M,x))}console.log(l.join("\n"))}}]);
