using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;
using System.Runtime.InteropServices.ComTypes;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var (A, B, Q) = Slice3<long>();
            const long MIN = long.MinValue / 10;
            const long MAX = long.MaxValue / 10;
            var si = new long[A + 4];
            si[0] = si[1] = MIN; si[A + 2] = si[A + 3] = MAX;
            for (var i = 2; i < A + 2; ++i)
                si[i] = Sarray()[0];
            var ti = new long[B + 4];
            ti[0] = ti[1] = MIN; ti[B + 2] = ti[B + 3] = MAX;
            for (var i = 2; i < B + 2; ++i)
                ti[i] = Sarray()[0];
            for (var i = 0; i < Q; ++i)
            {
                var x = Sarray()[0];
                var sldx = (~Array.BinarySearch(si, x, new lb<long>())) - 1;
                var tldx = (~Array.BinarySearch(ti, x, new lb<long>())) - 1;
                var dst = Max(Abs(x - si[sldx]), Abs(x - ti[tldx]));//左：神社、寺
                dst = Min(dst, 2 * Abs(x - si[sldx]) + Abs(x - ti[tldx + 1]));//左：神社、右：寺
                dst = Min(dst, Abs(x - si[sldx]) + 2 * Abs(x - ti[tldx + 1]));//左：神社、右：寺
                dst = Min(dst, 2 * Abs(x - si[sldx + 1]) + Abs(x - ti[tldx]));//左：寺、右：神社
                dst = Min(dst, Abs(x - si[sldx + 1]) + 2 * Abs(x - ti[tldx]));//左：寺、右：神社
                dst = Min(dst, Max(Abs(x - si[sldx + 1]), Abs(x - ti[tldx + 1])));//右：神社、寺
                WriteLine(dst);
            }
        }
        public class lb<T> : IComparer<T> where T : IComparable<T>
        {
            public int Compare(T x, T y) => 0 <= x.CompareTo(y) ? 1 : -1;
        }

        static long Mod = 998244353;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
        static public (T a, T b, T c, T d) Slice4<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)),
            (T)Convert.ChangeType(t[3], typeof(T)));
        }
    }
}

Measured memory_bytes: 48364