using System;
using System.Collections.Generic;
using static Assistant.Input;
using static Assistant.Debug;
using System.Linq;
using Assistant;
using System.Text;

namespace ABC119D
{
    class Program
    {
        static void Main(string[] args)
        {
            var A = ReadInt;
            var B = ReadInt;
            var Q = ReadInt;

            long[] s = new long[A];
            long[] t = new long[B];
            for (int i = 0; i < A; i++)
            {
                s[i] = ReadLong;
            }
            for (int i = 0; i < B; i++)
            {
                t[i] = ReadLong;
            }

            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < Q; i++)
            {
                long x = ReadLong;
                long shrine1 = -long.MaxValue;
                long shrine2 = long.MaxValue;
                long temple1 = -long.MaxValue;
                long temple2 = long.MaxValue;

                int index1 = LowerBound(s, x);
                int index2 = LowerBound(t, x);
                shrine1 = index1 - 1 >= 0 ? s[index1 - 1] : -long.MaxValue / 10;
                shrine2 = index1 < A ? s[index1] : long.MaxValue / 10;
                temple1 = index2 - 1 >= 0 ? t[index2 - 1] : -long.MaxValue / 10;
                temple2 = index2 < B ? t[index2] : long.MaxValue / 10;

                long[] cand = new long[6];
                cand[0] = Math.Max(shrine2, temple2) - x;
                cand[1] = x - Math.Min(shrine1, temple1);

                cand[2] = temple2 - x + temple2 - shrine1;
                cand[3] = x - temple1 + shrine2 - temple1;

                cand[4] = shrine2 - x + shrine2 - temple1;
                cand[5] = x - shrine1 + temple2 - shrine1;

                long ans = cand.Min();
                sb.AppendLine(ans.ToString());
            }

            Console.Write(sb);

        }

        /// <summary>
        /// 二分探索 key以上の最低
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="a"></param>
        /// <param name="v"></param>
        /// <returns></returns>
        public static int LowerBound<T>(T[] a, T v)
        {
            return LowerBound(a, v, Comparer<T>.Default);
        }

        public static int LowerBound<T>(T[] a, T v, Comparer<T> cmp)
        {
            var l = 0;
            var r = a.Length - 1;
            while (l <= r)
            {
                var mid = l + (r - l) / 2;
                var res = cmp.Compare(a[mid], v);
                if (res == -1) l = mid + 1;
                else r = mid - 1;
            }
            return l;
        }
    }


}

namespace Assistant
{
    static class Input
    {
        static List<string> line = new List<string>();
        static int index = 0;
        static String ReadNext()
        {
            if (line.Count <= index) line.AddRange(Console.ReadLine().Split());
            return line[index++];
        }
        public static int ReadInt => int.Parse(ReadNext());
        public static long ReadLong => long.Parse(ReadNext());
        public static int[] ReadInts => Console.ReadLine().Split().Select(int.Parse).ToArray();
        public static long[] NextLongs => Console.ReadLine().Split().Select(long.Parse).ToArray();
    }

    static class Debug
    {
        static public void Draw2D(int[,] map, int mode = 1)
        {
#if DEBUG
            int W = map.GetLength(0);
            int H = map.GetLength(1);

            int[,] map2 = new int[W + 1, H + 1];
            for (int i = 0; i < W + 1; i++)
            {
                for (int j = 0; j < H + 1; j++)
                {
                    if (i == 0 && j == 0) map2[i, j] = 0;
                    else if (i == 0) map2[i, j] = j - 1;
                    else if (j == 0) map2[i, j] = i - 1;
                    else map2[i, j] = map[i - 1, j - 1];
                }
            }

            for (int i = 0; i < W + 1; i++)
            {
                for (int j = 0; j < H + 1; j++)
                {
                    if (mode == 0) Console.Write(map2[i, j] % 10);
                    if (mode == 1) Console.Write(map2[i, j] + " ");
                }
                Console.WriteLine();
            }
            Console.WriteLine();
#endif
        }

        static void Draw1D(int[] array, int mode = 0)
        {
#if DEBUG
            Console.WriteLine(string.Join(" ", array));
#endif
        }
    }
}


Measured memory_bytes: 43788