using System;

public class S
{
    public static void Main()
	{
        var input = Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);

        var A = input[0];
        var B = input[1];
        var Q = input[2];

        var jinja = new long[A];
        var tera = new long[B];
        var quiz = new long[Q];
        var answer = new long[Q];
        long tmpAnswer = 0;
        long lbTera, lbJinja;

        for(int i = 0; i < A; i++){
            jinja[i] = long.Parse(Console.ReadLine());
        }
        for(int i = 0; i < B; i++){
            tera[i] = long.Parse(Console.ReadLine());
        }
        for(int i = 0; i < Q; i++){
            quiz[i] = long.Parse(Console.ReadLine());
            lbTera = lower_bound(tera, quiz[i]);
            lbJinja = lower_bound(jinja, quiz[i]);
            tmpAnswer = long.MaxValue;
            // 0,0
            if(lbTera >= 0 && lbJinja >= 0){
                if(tera[lbTera] > jinja[lbJinja]){
                    tmpAnswer = Math.Min(tmpAnswer, (quiz[i] - tera[lbTera]) + (tera[lbTera] - jinja[lbJinja]));
                }else{
                    tmpAnswer = Math.Min(tmpAnswer, (quiz[i] - jinja[lbJinja]) + (jinja[lbJinja] - tera[lbTera]));
                }
            }
            // 1,1
            if(lbTera < B-1 && lbJinja < A-1){
                if(tera[lbTera+1] > jinja[lbJinja+1]){
                    tmpAnswer = Math.Min(tmpAnswer, (jinja[lbJinja+1] - quiz[i]) + (tera[lbTera+1] - jinja[lbJinja+1]));
                }else{
                    tmpAnswer = Math.Min(tmpAnswer, (tera[lbTera+1] - quiz[i]) + (jinja[lbJinja+1] - tera[lbTera+1]));
                }
            }
            // 1,0
            if(lbTera < B-1 && lbJinja >= 0){
                if(Math.Abs(tera[lbTera+1] - quiz[i]) > Math.Abs(jinja[lbJinja] - quiz[i])){
                    tmpAnswer = Math.Min(tmpAnswer, (quiz[i] - jinja[lbJinja]) + (tera[lbTera+1] - jinja[lbJinja]));
                }else{
                    tmpAnswer = Math.Min(tmpAnswer, (tera[lbTera+1] - quiz[i]) + (tera[lbTera+1] - jinja[lbJinja]));
                }
            }
            // 0,1
            if(lbTera >= 0 && lbJinja < A-1){
                if(Math.Abs(tera[lbTera] - quiz[i]) > Math.Abs(jinja[lbJinja+1] - quiz[i])){
                    tmpAnswer = Math.Min(tmpAnswer, (jinja[lbJinja+1] - quiz[i]) + (jinja[lbJinja+1] - tera[lbTera]));
                }else{
                    tmpAnswer = Math.Min(tmpAnswer, (quiz[i] - tera[lbTera]) + (jinja[lbJinja+1] - tera[lbTera]));
                }
            }


            answer[i] = tmpAnswer;



        }
        
        foreach(var tgt in answer){
            Console.WriteLine(tgt);
        }
        


    }

    public static long lower_bound(long[] array, long input){
        var left = 0;
        var right = array.Length-1;
        var mid =0;
        while(right >= left){
            mid = left + (right - left)/2;
            if(array[mid] == input){
                return mid;
            }
            if(array[mid] > input){
                right = mid-1;
            }else{
                left = mid+1;
            }
        }

        return right;
    }

}

Measured memory_bytes: 19280