using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int A, B, Q;
        public long MOD = 1000000007;
        public long[] S, T, X;
        public BinarySearch BS, BSB;

        public void Run()
        {
            {
                var line = Input.ReadIntArray();
                A = line[0];
                B = line[1];
                Q = line[2];
            }

            S = new long[A];
            T = new long[B];
            X = new long[Q];

            for (int i = 0; i < A; i++)
            {
                S[i] = Input.ReadLong();
            }

            for (int i = 0; i < B; i++)
            {
                T[i] = Input.ReadLong();
            }
            for (int q = 0; q < Q; q++)
            {
                X[q] = Input.ReadLong();
            }

            BS = new BinarySearch();
            for (int q = 0; q < Q; q++)
            {
                Console.WriteLine(Answer(X[q]));
            }
        }

        public long Answer(long x)
        {
            long ret = long.MaxValue;

            ret = Math.Min(ret, Answer(x, true, S, T));
            ret = Math.Min(ret, Answer(x, false, S, T));
            ret = Math.Min(ret, Answer(x, true, T, S));
            ret = Math.Min(ret, Answer(x, false, T, S));
            return ret;
        }

        public long Answer(long x, bool left, long[] Ary1, long[] Ary2)
        {
            long ret = long.MaxValue;

            int a = -1, b = -1;
            long xa = -1, xb1 = -1, xb2 = -1;
            a = SearchIndex(x, Ary1) + (left ? -1 : 0);

            if (a >= 0 && a < Ary1.Length)
            {
                xa = Ary1[a];
                b = SearchIndex(xa, Ary2);
                if (b >= 0 && b < Ary2.Length)
                {
                    xb1 = Ary2[b];
                    ret = Math.Min(ret, Math.Abs(x - xa) + Math.Abs(xa - xb1));
                }

                b -= 1;
                if (b >= 0 && b < Ary2.Length)
                {
                    xb2 = Ary2[b];
                    ret = Math.Min(ret, Math.Abs(x - xa) + Math.Abs(xa - xb2));
                }
            }

            // Console.Error.WriteLine($"x:{x} a:{a} b:{b} {xa} {xb1} {xb2}");
            return ret;
        }

        public int SearchIndex(long x, long[] Ary)
        {
            return BS.Search(x, Ary);
        }


    }

    // libs ----------
    internal class BinarySearch
    {
        public long[] S;
        public int N { get { return S.Length; } }

        // 左側がfalse, 右側がtrueである必要がある
        public bool Cond(int i, long x)
        {
            if (S[i] >= x) return true;
            return false;
        }

        // 初めてCondがtrueを返すindexを返す
        // 全て条件を満たさない場合はNを返す
        public int Search(long x, long[] ary)
        {
            S = ary;

            int left = 0;
            int right = N;

            if (Cond(0, x)) return 0;
            if (!Cond(N - 1, x)) return N;

            while (left + 1 < right)
            {
                int mid = (left + right) / 2;
                if (!Cond(mid, x))
                {
                    left = mid;
                }
                else
                {
                    right = mid;
                }
            }
            return right;
        }
    }

    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 20688