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

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = ReadArrayInt();
            var A = input[0];
            var B = input[1];
            var Q = input[2];

            var S = new long[A];
            var T = new long[B];
            for (int i = 0; i < A; i++) S[i] = ReadLong();
            for (int i = 0; i < B; i++) T[i] = ReadLong();
            var St = new long[A];
            var Ts = new long[B];
            for (int i = 0; i < A; i++)
            {
                var idx = LowerBound(T, S[i]);
                if (idx == B) St[i] = Math.Abs(S[i] - T[idx - 1]);
                else if(idx==0) St[i] = Math.Abs(S[i] - T[0]);
                else
                {
                    St[i] = Math.Min(Math.Abs(S[i] - T[idx]), Math.Abs(S[i] - T[idx - 1]));
                }
            }
            for (int i = 0; i < B; i++)
            {
                var idx = LowerBound(S, T[i]);
                if (idx == A) Ts[i] = Math.Abs(T[i] - S[idx - 1]);
                else if (idx == 0) Ts[i] = Math.Abs(T[i] - S[0]);
                else
                {
                    Ts[i] = Math.Min(Math.Abs(T[i] - S[idx]), Math.Abs(T[i] - S[idx - 1]));
                }
            }

            for (int i = 0; i < Q; i++)
            {
                var x = ReadLong();
                var s = 0L;
                var sIdx = LowerBound(S, x);
                if (sIdx == A) s = Math.Abs(x - S[sIdx - 1]) + St[sIdx - 1];
                else if (x == S[sIdx]) s = St[sIdx];
                else if (sIdx == 0) s = Math.Abs(x - S[0]) + St[0];
                else
                {
                    s = Math.Min(Math.Abs(x - S[sIdx]) + St[sIdx], Math.Abs(x - S[sIdx - 1]) + St[sIdx - 1]);
                }
                var t = 0L;
                var tIdx = LowerBound(T, x);
                if (tIdx == B) t = Math.Abs(x - T[tIdx - 1]) + Ts[tIdx - 1];
                else if (x == T[tIdx]) t = Ts[tIdx];
                else if (tIdx == 0) t = Math.Abs(x - T[0]) + Ts[0];
                else
                {
                    t = Math.Min(Math.Abs(x - T[tIdx]) + Ts[tIdx], Math.Abs(x - T[tIdx - 1]) + Ts[tIdx - 1]);
                }
                Console.WriteLine(Math.Min(s, t));
            }

            Console.WriteLine();
            Console.ReadLine();
        }

        static int LowerBound(long[] arr, long val)
        {
            if (arr[0] >= val) return 0;
            if (arr[arr.Length - 1] < val) return arr.Length;

            var low = 0;
            var high = arr.Length - 1;

            while (low + 1 < high)
            {
                var mid = (low + high) / 2;
                if (arr[mid] >= val) high = mid;
                else low = mid;
            }

            return high;
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 19408