package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"os"
	"strconv"
)

func bs(v []int, find int) int {
	if find <= v[0] {
		return 0
	}
	if find >= v[len(v)-1] {
		return len(v) - 1
	}
	var right, left, res int
	res = -1 // 見つからなかったときの戻り値
	left = 0
	right = len(v) - 1
	for left <= right {
		middle := (left + right) / 2
		if v[middle] > find {
			res = middle
			right = middle - 1
		} else {
			left = middle + 1
		}
	}
	if abs(find-v[right]) < abs(find-v[res]) {
		res = right
	}
	if abs(find-v[left]) < abs(find-v[res]) {
		res = left
	}
	return res
}

func main() {
	A := nextInt()
	B := nextInt()
	Q := nextInt()
	s := nextInts(A)
	t := nextInts(B)
	x := nextInts(Q)
	for i := 0; i < Q; i++ {
		minLen := 200000000000
		sidx := bs(s, x[i])
		tidx := bs(t, x[i])
		if s[sidx]-x[i] <= 0 && t[tidx]-x[i] <= 0 {
			minLen = min(minLen, max(x[i]-s[sidx], x[i]-t[tidx]))
			log.Println(minLen)
		}
		if s[sidx]-x[i] >= 0 && t[tidx]-x[i] >= 0 {
			minLen = min(minLen, max(s[sidx]-x[i], t[tidx]-x[i]))
			// log.Println(minLen)
		}
		if s[sidx] < x[i] && x[i] < t[tidx] {
			minLen = min(minLen, min(x[i]-s[sidx], t[tidx]-x[i])+t[tidx]-s[sidx])
			if tidx != 0 {
				minLen = min(minLen, max(x[i]-s[sidx], x[i]-t[tidx-1]))
			}
			if sidx < len(s)-1 {
				minLen = min(minLen, max(s[sidx+1]-x[i], t[tidx]-x[i]))
			}
			// log.Println(minLen)
		}
		if t[tidx] < x[i] && x[i] < s[sidx] {
			minLen = min(minLen, min(x[i]-t[tidx], s[sidx]-x[i])+s[sidx]-t[tidx])
			if sidx != 0 {
				minLen = min(minLen, max(x[i]-t[tidx], x[i]-s[sidx-1]))
			}
			if tidx < len(t)-1 {
				minLen = min(minLen, max(t[tidx+1]-x[i], s[sidx]-x[i]))
			}
		}
		fmt.Println(minLen)
	}
}

var dy = []int{1, 0, -1, 0, 0}
var dx = []int{0, 1, 0, -1, 0}
var inf = int(1e9)

func fill(a *[]int, n int) {
	for i := 0; i < len(*a); i++ {
		(*a)[i] = n
	}
}

func makeDoubleSlice(n int, m int) [][]int {
	s := make([][]int, n)
	for i := 0; i < n; i++ {
		s[i] = make([]int, m)
	}
	return s
}

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type pair struct {
	a, b int
}

type pairs []pair

func (p pairs) Len() int {
	return len(p)
}
func (p pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}

var nextReader func() []byte

func init() {
	nextReader = newScanner()
	log.SetFlags(log.Lshortfile)
}

func newScanner() func() []byte {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() []byte {
		r.Scan()
		return r.Bytes()
	}
}
func nextBytes() []byte {
	return nextReader()
}

func nextString() string {
	return string(nextReader())
}
func nextInt64() int64 {
	v, _ := strconv.ParseInt(string(nextReader()), 10, 64)
	return v
}
func nextInt() int {
	v, _ := strconv.Atoi(string(nextReader()))
	return v
}
func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}
func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(string(nextReader()), 64)
	return f
}


Measured memory_bytes: 7552