using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    partial class Program
    {
        static long mod = 1000000007;
        static void Swap<T>(ref T a, ref T b) { T temp = a; a = b; b = temp; }
        static void Main()
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            Solve();
            Console.Out.Flush();
            Console.ReadKey();
        }

        //ここから
        static void Solve()
        {
            int A;int B;int Q;
            Multi(out A, out B, out Q);
            var S = Enumerable.Repeat(0, A).Select(s => GetLong()).ToArray();
            var T = Enumerable.Repeat(0, B).Select(s => GetLong()).ToArray();
            var X = Enumerable.Repeat(0, Q).Select(s => GetLong()).ToArray();

            for (int i = 0; i < Q; i++)
            {
                int ok; int ng;
                long ra=0; long la=0; long rb=0; long lb=0;

                ok = A;
                ng = -1;
                while (Math.Abs(ok - ng) > 1)
                {
                    var mid = (ok + ng) / 2;
                    if (IsOK(1, S, mid, X[i])) ok = mid;
                    else ng = mid;
                }
                if (ok == -1) ra = (long)Math.Pow(-10, 15);
                else if (ok == A) ra = (long)Math.Pow(10, 15);
                else ra = S[ok];

                ok = -1;
                ng = A;
                while (Math.Abs(ok - ng) > 1)
                {
                    var mid = (ok + ng) / 2;
                    if (IsOK(0, S, mid, X[i])) ok = mid;
                    else ng = mid;
                }
                if (ok == -1) la = (long)Math.Pow(-10, 15);
                else if (ok == A) la = (long)Math.Pow(10, 15);
                else la = S[ok];

                ok =B;
                ng = -1;
                while (Math.Abs(ok - ng) > 1)
                {
                    var mid = (ok + ng) / 2;
                    if (IsOK(1, T, mid, X[i])) ok = mid;
                    else ng = mid;
                }
                if (ok == -1) rb = (long)Math.Pow(-10, 15);
                else if (ok == B) rb = (long)Math.Pow(10, 15);
                else rb = T[ok];

                ok = -1;
                ng = B;
                while (Math.Abs(ok - ng) > 1)
                {
                    var mid = (ok + ng) / 2;
                    if (IsOK(0, T, mid, X[i])) ok = mid;
                    else ng = mid;
                }
                if (ok == -1) lb = (long)Math.Pow(-10, 15);
                else if (ok == B) lb = (long)Math.Pow(10, 15);
                else lb = T[ok];


                long ans;
                if (la <= lb && rb <= ra)
                {
                    ans = Math.Min(ra - X[i], X[i] - la);
                }
                else
                if (lb <= la && ra <= rb)
                {
                    ans = Math.Min(rb - X[i], X[i] - lb);
                }
                else
                if (la <= lb && ra <= rb)
                {
                    ans = Math.Min(Math.Min(X[i] - la, rb - X[i]), Math.Min((ra - X[i]) * 2 + X[i] - lb, (X[i] - lb) * 2 + ra - X[i]));
                }
                else
                {
                    ans = Math.Min(Math.Min(X[i] - lb, ra - X[i]), Math.Min((rb - X[i]) * 2 + X[i] - la, (X[i] - la) * 2 + rb - X[i]));
                }
                Console.WriteLine(ans);
            }

            //Console.WriteLine();
        }

        static bool IsOK(int type,long[] array,int index,long key)
        {
            if (type == 1)
            {
                if (array[index] >= key) return true;
                return false;
            }
            else
            {
                if (array[index] <= key) return true;
                return false;
            }
        }
    }



    //拡張メソッド
    public static class Ex
    {
        public static List<string> FastSort(this List<string> s) { s.Sort(StringComparer.Ordinal); return s.ToList(); }
        public static string yesno(this bool b) { return b ? "yes" : "no"; }
        public static string YesNo(this bool b) { return b ? "Yes" : "No"; }
        public static string YESNO(this bool b) { return b ? "YES" : "NO"; }
    }

    partial class Program
    {
        static public string GetStr() { return Console.ReadLine().Trim(); }
        static public char GetChar() { return Console.ReadLine().Trim()[0]; }
        static public int GetInt() { return int.Parse(Console.ReadLine().Trim()); }
        static public long GetLong() { return long.Parse(Console.ReadLine().Trim()); }
        static public double GetDouble() { return double.Parse(Console.ReadLine().Trim()); }
        static public string[] GetStrArray() { return Console.ReadLine().Trim().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray(); }
        static public char[] GetCharArray() { return Console.ReadLine().Trim().Split(' ').Select(char.Parse).ToArray(); }
        static public double[] GetDoubleArray() { return Console.ReadLine().Trim().Split(' ').Select(double.Parse).ToArray(); }
        static public T[][] CreateJaggedArray<T>(int H, int W, T value) { return Enumerable.Repeat(0, H).Select(s => Enumerable.Repeat(value, W).ToArray()).ToArray(); }
        static public int[][] GetIntJaggedArray(int N) { return Enumerable.Repeat(0, N).Select(s => GetIntArray().ToArray()).ToArray(); }
        static public long[][] GetLongJaggedArray(int N) { return Enumerable.Repeat(0, N).Select(s => GetLongArray().ToArray()).ToArray(); }
        static public char[][] GetCharJaggedArray(int N) { return Enumerable.Repeat(0, N).Select(s => GetStr().ToCharArray()).ToArray(); }
        static public double[][] GetDoubleJaggedArray(int N) { return Enumerable.Repeat(0, N).Select(s => GetDoubleArray()).ToArray(); }


        static public void WriteObjects<T>(IReadOnlyCollection<T> values) { var array = values.ToArray(); var num = array.Length; if (num == 0) return; Console.Write(array[0]); for (int i = 1; i < num; i++) { Console.Write(" " + array[i]); } Console.WriteLine(); }

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                           : eq<T, long>() ? ct<T, long>(long.Parse(s))
                           : eq<T, double>() ? ct<T, double>(double.Parse(s))
                           : eq<T, char>() ? ct<T, char>(s[0])
                                             : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(GetStr());
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }
        static void Multi<T, U, V, W>(out T a, out U b, out V c, out W d)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]);
        }
        static void Multi<T, U, V, W, X>(out T a, out U b, out V c, out W d, out X e)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]); e = cv<X>(ar[4]);
        }
        static void Multi<T, U, V, W, X, Y>(out T a, out U b, out V c, out W d, out X e, out Y f)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]); e = cv<X>(ar[4]); f = cv<Y>(ar[5]);
        }
    }
}

Measured memory_bytes: 24144