using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Math;
using static System.Array;
namespace AtCoderSolve
{
    class Solve
    {
        const int mod = 1000000007;
        const int INF = 2147483647;
        const long SINF = 9223372036854775807;

        static int A, B, Q;
        static long[] s, t, x;
        

        public static void Input()
        {
            var cin = new Scanner();
            var input = cin.SplitReader();
            A = input[0];
            B = input[1];
            Q = input[2];
            s = cin.MultiLineReaderL(A);
            t = cin.MultiLineReaderL(B);
            x = cin.MultiLineReaderL(Q);
            
        }

        static void Main(string[] args)
        {
            Input();
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            long[] ans = new long[Q];

            for(var i = 0; i < Q; i++)
            {
                int ss = UpperBound(s, x[i]);
                int tt = UpperBound(t, x[i]);
                long sltl, sltr, srtl, srtr;

                if (ss > 0 && tt > 0)
                {
                    sltl = x[i] - Min(s[ss - 1], t[tt - 1]);
                }
                else
                {
                    sltl = SINF;
                }

                if (ss > 0 && tt < t.Length)
                {
                    sltr = Min(Abs(x[i] - s[ss - 1]), Abs(x[i] - t[tt])) + t[tt] - s[ss - 1];
                }
                else
                {
                    sltr = SINF;
                }

                if (ss < s.Length && tt > 0)
                {
                    srtl = Min(Abs(x[i] - s[ss]), Abs(x[i] - t[tt - 1])) + s[ss] - t[tt - 1];
                }
                else
                {
                    srtl = SINF;
                }

                if (ss < s.Length && tt < t.Length)
                {
                    srtr = Max(s[ss], t[tt]) - x[i];
                }
                else
                {
                    srtr = SINF;
                }

                ans[i] = Min(Min(sltl, sltr), Min(srtl, srtr));

            }

            for(var i = 0; i < Q; i++)
            {
                Console.WriteLine(ans[i]);
            }

            Console.Out.Flush();
        }


        public static int UpperBound(long[] array, long x)
        {
            int l = -1;
            int r = array.Length;

            while (r - l > 1)
            {
                int c = (l + r) / 2;
                if (array[c] > x) 
                {
                    r = c;
                }
                else //true
                {
                    l = c;
                }
            }
            return r;
        }

    }

    public class Scanner
    {
        public int[] SplitReader()
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return array;
        }
        public long[] SplitReaderL()
        {
            long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return array;
        }

        public int[] MultiLineReader(int N)
        {
            int[] ret = new int[N];
            for(var i = 0; i < N; i++)
            {
                ret[i] = int.Parse(Console.ReadLine());
            }

            return ret;
        }
        public long[] MultiLineReaderL(int N)
        {
            long[] ret = new long[N];
            for (var i = 0; i < N; i++)
            {
                ret[i] = long.Parse(Console.ReadLine());
            }

            return ret;
        }

    }

    public class Graph
    {
        
    }
}

    



Measured memory_bytes: 19408