using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    private const int INF = 1000000007;
    public static void Main()
    {
        int A = NextInt();
        int B = NextInt();
        int Q = NextInt();
        List<long> si = new List<long>();
        for (int i = 0; i < A; i++) si.Add(NextLong());
        List<long> ti = new List<long>();
        for (int i = 0; i < B; i++) ti.Add(NextLong());
        for (int i = 0; i < Q; i++)
        {
            long x = NextLong();
            int s0 = LessSearch(si, x);
            int s1 = Math.Min(s0 + 1, A - 1);
            if (s0 == -1) { s0 = 0; }
            int t0 = LessSearch(ti, x);
            int t1 = Math.Min(t0 + 1, B - 1);
            if (t0 == -1) { t0 = 0; }


            //右行って左行くみたいな
            //折り返しケース
            long case0 = Math.Max(x, Math.Max(si[s0], ti[t0])) - Math.Min(x, Math.Min(si[s0], ti[t0]));
            if ((si[s0] < x && x < ti[t0]) || (ti[t0] < x && x < si[s0])) case0 +=  Math.Min(Math.Abs(si[s0] - x), Math.Abs(ti[t0] - x));

            long case1 = Math.Max(x, Math.Max(si[s0], ti[t1])) - Math.Min(x, Math.Min(si[s0], ti[t1]));
            if ((si[s0] < x && x < ti[t1]) || (ti[t1] < x && x < si[s0])) case1 += Math.Min(Math.Abs(si[s0] - x), Math.Abs(ti[t1] - x));

            long case2 = Math.Max(x, Math.Max(si[s1], ti[t0])) - Math.Min(x, Math.Min(si[s1], ti[t0]));
            if ((si[s1] < x && x < ti[t0]) || (ti[t0] < x && x < si[s1])) case2 +=  Math.Min(Math.Abs(si[s1] - x), Math.Abs(ti[t0] - x));

            long case3 = Math.Max(x, Math.Max(si[s1], ti[t1])) - Math.Min(x, Math.Min(si[s1], ti[t1]));
            if ((si[s1] < x && x < ti[t1]) || (ti[t1] < x && x < si[s1])) case3 += Math.Min(Math.Abs(si[s1] - x), Math.Abs(ti[t1] - x));

            Console.WriteLine(Math.Min(Math.Min(case0, case1), Math.Min(case2, case3)));
        }
    }

    private static int LessSearch(List<long> list, long n)
    {
        int a = 0, b = list.Count();
        if (list[b - 1] <= n) return b - 1;
        else if (list[a] > n) return -1;
        while (b - a != 1)
        {
            int x = (a + b) / 2;
            if (list[x] <= n) a = x;
            else b = x;
        }
        return a;
    }
}

public class Input
{
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

Measured memory_bytes: 19904