package main

import (
	"bufio"
	_ "container/heap"
	"fmt"
	"os"
	_ "sort"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	return a / gcd(a, b) * b
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
const MOD = int(1e+9) + 7
const INF = 1 << 60

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	defer wtr.Flush()
	A, B, Q := sc.nextInt(), sc.nextInt(), sc.nextInt()
	S := sc.nextIntSlice(A)
	T := sc.nextIntSlice(B)
	X := sc.nextIntSlice(Q)
	for i := 0; i < Q; i++ {
		x := X[i]
		a1, okA1 := search(x, S)
		a2, okA2 := search2(x, S)
		b1, okB1 := search(x, T)
		b2, okB2 := search2(x, T)
		//fmt.Fprintln(wtr, x, a1, a2, b1, b2)
		ans := INF
		if okA1 && okB1 {
			ans = min(ans, max(abs(x-a1), abs(x-b1)))
		}
		if okA2 && okB2 {
			ans = min(ans, max(abs(x-a2), abs(x-b2)))
		}
		if okA1 && okB2 {
			mn := min(abs(x-a1), abs(x-b2))
			mx := max(abs(x-a1), abs(x-b2))
			ans = min(ans, mn*2+mx)
		}
		if okA2 && okB1 {
			mn := min(abs(x-a2), abs(x-b1))
			mx := max(abs(x-a2), abs(x-b1))
			ans = min(ans, mn*2+mx)
		}
		fmt.Fprintln(wtr, ans)
	}
}

func search(key int, a []int) (int, bool) {
	ng := len(a)
	ok := -1
	for abs(ok-ng) > 1 {
		mid := (ok + ng) / 2
		// 西をさがす
		if a[mid] <= key {
			ok = mid
		} else {
			ng = mid
		}
	}
	if ok == -1 {
		return 0, false
	} else {
		return a[ok], true
	}
}

func search2(key int, a []int) (int, bool) {
	ng := -1
	ok := len(a)
	for abs(ok-ng) > 1 {
		mid := (ok + ng) / 2
		// 東をさがす
		if a[mid] >= key {
			ok = mid
		} else {
			ng = mid
		}
	}
	if ok == len(a) {
		return 0, false
	} else {
		return a[ok], true
	}
}


Measured memory_bytes: 7424