/* package codechef; // don’t place package name! */
import java.util.;
import java.lang.;
import java.io.*;
/* Name of the class has to be “Main” only if the class is public. */
class CodeTime
{
public int t1;
public int t2;
public int getT1() {
return t1;
}
public void setT1(int t1) {
this.t1 = t1;
}
public int getT2() {
return t2;
}
public void setT2(int t2) {
this.t2 = t2;
}
public CodeTime(int t1, int t2) {
this.t1 = t1;
this.t2 = t2;
}
}
class codechef{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
int n,nx,ny,z=0,fi=0;
int c=0,min=999;
int v[];
int w[];
int ti[];
try(Scanner sc=new Scanner(System.in)) {
ArrayList<CodeTime> ct = new ArrayList<CodeTime>();
n=sc.nextInt();
ti=new int[n];
nx=sc.nextInt();
ny=sc.nextInt();
v=new int[nx];
w=new int[ny];
for(int i=0;i<n;i++){
int t1=sc.nextInt();
int t2=sc.nextInt();
ct.add(new CodeTime(t1,t2));
}
for(int i=0;i<n;i++){
ti[i]=0;
}
for(int i=0;i<nx;i++){
v[i]=sc.nextInt();
}
for(int i=0;i<ny;i++){
w[i]=sc.nextInt();
}
int i=0,j=0,k=0;
Arrays.sort(v);
Arrays.sort(w);
timr:while(true){
if(i<n&&j<nx&&k<ny){
if((ct.get(i)).t1>=v[j])
{
while(v[j+1]<=ct.get(i).t1)
j++;
if(ct.get(i).t2<=w[k]){
ti[z]=w[k]-v[j]+1;
z++;;
ct.remove(i);
n--;
c++;
i=0;
j=0;
k=0;
continue timr;
}
else{
k++;
continue timr;
}
}else{
i++;
continue timr;
}
}
for(int ik=0;ik<c;ik++){
if(ti[ik]<min)min=ti[ik];
}
System.out.println(min);
break;
}
Arrays.sort(ti);
//System.out.println(ti[0]);
}
catch(Exception e) {
}
}
}