import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
for(int i = 0; i < n; i++){
numStr.append(sc.nextLine());
numStr.append(" ");
}
int x = sc.nextInt();
int y = sc.nextInt();
String str = new String(numStr);
String[] nums = str.split(" ");
System.out.println(nums[(x-1)*m+y-1]);
}
}
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
StringBuilder numStr = new StringBuilder();
//要用nextLine需要先把m后面的换行符读取
sc.nextLine();for(int i = 0; i < n; i++){
numStr.append(sc.nextLine());
numStr.append(" ");
}
int x = sc.nextInt();
int y = sc.nextInt();
String str = new String(numStr);
String[] nums = str.split(" ");
System.out.println(nums[(x-1)*m+y-1]);
}
}