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



namespace CSharpSample01
{

    

    class Program
    {
        static long[] s;
        static long[] t;

        static bool Check(bool up, long[] a, int mid, long key)
        {
            if (up)
            {
                if (a[mid] <= key) return true;
                else return false;
            }
            else
            {
                if (a[mid] >= key) return true;
                else return false;
            }
        }

        static long UL_Bound(bool up, long[] a, long key)
        {
            int ok = a.Length;  
            int ng = -1; 

            if (up)
            {
                int tmp = ok;
                ok = ng;
                ng = tmp;
            }

            while (Math.Abs(ok - ng) > 1)
            {
                int mid = (ok + ng) / 2;
                //条件を満たすかをチェック
                //条件 : mid >= K ture ならlower
                //条件 : mid <= K ture ならupper
                if (Check(up, a, mid, key))
                {
                    ok = mid;
                }
                else
                {
                    ng = mid;
                }
            }

            if (ok < 0 || ok >= a.Length) return -1;

            return a[ok];
        }

        static long Solve(long x)
        {

            //Lower, Upperで2分探索して
            //左右の近場の神社と寺を見つける
            List<long> sh = new List<long>();
            List<long> te = new List<long>();

            sh.Add(UL_Bound(false, s, x));
            sh.Add(UL_Bound(true, s, x));
            te.Add(UL_Bound(false, t, x));
            te.Add(UL_Bound(true, t, x));
            //foreach (var s in sh) Console.WriteLine($"sh:{s}");
            //foreach (var s in te) Console.WriteLine($"te:{s}");

            //見つけた神社(1～2つ)と寺(1～2つ)において
            //xからの8通りの行き方の距離を計算し、一番小さいものを答えとする
            long rec = 1000000000000;


            //最初に神社へ
            for(int i = 0; i < 2; i++)
            {
                if (sh[i] == -1) continue;
                long d = (long)Math.Abs(x - sh[i]);
                for(int j = 0; j < 2; j++)
                {
                    if (te[j] == -1) continue;
                    rec = Math.Min(rec, d + Math.Abs(sh[i] - te[j]));
                }
            }

            //最初に寺へ
            for (int j = 0; j < 2; j++)
            {
                if (te[j] == -1) continue;
                long d = (long)Math.Abs(x - te[j]);
                for (int i = 0; i < 2; i++)
                {
                    if (sh[i] == -1) continue;
                    rec = Math.Min(rec, d + Math.Abs(sh[i] - te[j]));
                }
            }

            return rec;
        }
              
        static void Main(string[] args)
        {
            //N, K, Aの入力
            string[] input = Console.ReadLine().Split(' ');
            int A = int.Parse(input[0]);
            int B = int.Parse(input[1]);
            int Q = int.Parse(input[2]);

            s = new long[A];
            t = new long[B];

            for(int i = 0; i < A; i++)
            {
                s[i] = long.Parse(Console.ReadLine());
            }
            for(int i = 0; i < B; i++)
            {
                t[i] = long.Parse(Console.ReadLine());
            }

            for(int i = 0; i < Q; i++)
            { 
                long x = long.Parse(Console.ReadLine());
                //Console.WriteLine($"{i + 1}番目");
                Console.WriteLine(Solve(x));
            }



        }
    }
}

Measured memory_bytes: 17968