import bisect
import sys
class Bintree:
    def __init__(self,data=None): # デフォルト値を使うのはrootのみ
        self.data = data
        self.left = None
        self.right = None
    def search(self,data):
        if self.data == None:
            return None
        if data < self.data:
            if self.left == None:
                return None # 左の子がなければない
            else:
                return self.left.search(data) # 左の子があれば左の子(の下を)再帰的に検索
        elif data > self.data:
            if self.right == None:
                return None
            else:
                return self.right.search(data)
        else: # data == self.dataなら発見
            return self
    
    def insert(self,data):
        if self.data == None:
            self.data = data
            return self
        if data < self.data:
            if self.left == None:
                self.left = Bintree(data) # 左の子がなければ、そこに頂点を作って登録
                return True
            else:
                return self.left.insert(data)
        elif data > self.data:
            if self.right == None:
                self.right = Bintree(data)
                return True
            else:
                return self.right.insert(data)
        else: # data == self.data:
            return False
    def to_s(self):
        return self.data
    def left_s(self):
        if self.left==None:
            return None
        return (self.left).data
    def right_s(self):
        if self.right == None:
            return None
        return (self.right).data

input = sys.stdin.readline
a, b, q = map(int,input().split())
s = [int(input()) for i in range(a)]
t = [int(input()) for i in range(b)]
x = [int(input()) for i in range(q)]
lens, lent = len(s), len(t)
treeA, treeB = Bintree(), Bintree()
for i in s: treeA.insert(i) # 木を作る
for i in t: treeB.insert(i)


### FIXED CODE ###

#       )                         .MMdMMM;                    .M#(,dM]                        .:
#       )                        .M@d@d#Mb                    dMGMM(MN                        .:
#       )                        dM1MCdbMM_                  .M@MSN;dM-                       .:
#       )                       .M#(#?d#(Mb.. ...............JMIMIMLdM]                       .:
#       )                      ..M#?NHM# ?MMMMMMMMMH"""""""HMM@(Nad#(Mb                       .:
#       )                  .(MMMMH=..-(Jg[   `               daggmp  MNm,                     .:
#       )                ..MMY`     !qN;                       (J     ?MMN,                   .:
#       )               (MMD`       .MM@                      .MM{      .WMN,                 .:
#       )              dM@`         dMM%                      .MM}        (MMm                .:
#       )             .M#`          dMN!                      .MM}        ~(MMr               .:
#       )            .MM:           dM#                       .MM}        ..JM#               .:
#       )      ``    .M@            dMF                       .MM}        .~(M#   `  .        .:
#       )      ?MMMMMMMNgJ,         .7`                        T"!       .JJjMNgNNMMMB^       .:
#       )            dMr ?Mm,                                            7YYMM#!`             .:
#       )            dMb   ?`                  .,   ` ..                 ~.(MM%               .:
#       )         ..JgMMNNN)                  .Mn.(Mm-JM{               dHHMMNag.,            .:
#       )         ("!  ?MN,..,                (NM@"`~OMM}             ..~-(M@` _?"M[          .:
#       )               ,MMM#_                .M#    .M#`           .~.~JMMMNg-..             .:
#       )           ..gMB"?TMMNJ..              `     _`         .~~.(JdM#^  _"TMMNgJ-,       .:
#       )        .gMB=`      _7WMMNaJ...                 ....__-(JJgMMMM^          ?T"^       .:
#       )           ............  ?TWMMMMNNNNgggggggggggggNNMMMMMMBY7`...                     .:
#       )           WMMMMMMMMMMMMMNgJ,   (dMMMM#"TYYYYYYMMMMMMMNgMMMMMMMMMMMNNgJ-,            .:
#       )            -?TMNmuuuuUWMMMMMMNNMM@g@MMmJ--_(JMMg@g@@gMMMMMMWUXXXUWMMMMMMNe.         .:

import sys
import bisect
input = sys.stdin.readline

a,b,q = map(int,input().split())
s = []
t = []
for i in range(a):
    S = int(input())
    s.append(S)
for i in range(b):
    T = int(input())
    t.append(T)
s.sort()
t.sort()

def f(x):
    if 0<=x and a-1>= x:
        return True
    return False
def g(x):
    if 0<=x and b-1>= x:
        return True
    return False
for i in range(q):
    x = int(input())
    p = bisect.bisect_left(s,x)
    m = bisect.bisect_left(t,x)
    
    res = []
    if f(p) and g(m):
        res.append(max(t[m],s[p])-x)
    if f(p) and g(m-1):
        res.append(min(s[p]-x,x-t[m-1])+s[p]-t[m-1])
    if f(p-1) and g(m):
        res.append(t[m]-s[p-1]+min(t[m]-x,x-s[p-1]))
    if f(p-1) and g(m-1):
        res.append(x-min(t[m-1],s[p-1]))
    print(min(res))