codeparrot/codecomplex huggingface dataset:
// Problem: 1515_E. Phoenix and Computers
// Time complexity: cubic
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Practice {
	public static long mod = (long) Math.pow(10, 9) + 7;
	public static long[][] dp;

	public static void main(String[] args) throws Exception {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);

		String[] s2 = br.readLine().split(" ");

		int n = (int) Long.parseLong(s2[0]);
		long m = Long.parseLong(s2[1]);
		dp = new long[n + 2][n + 2];
		long[] power = new long[n + 1];
		mod = m;
		long[][] choose = new long[n + 2][n + 2];
		getPow(power, n + 1);
		getChoose(choose, n + 2, n + 2);
		dp[0][0] = 1;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j <= i; j++) {
				for (int k = 1; k + i <= n; k++) {
				//	System.out.println((j + k) + " " + k + " - " + choose[j + k][k]);
					dp[i + k + 1][j
							+ k] = (dp[i + k + 1][j + k] + (((dp[i][j] * power[k - 1]) % mod) * choose[j + k][k]) % mod)
									% mod;
				}
			}
		}
		long ans = 0;
		for (int i = 0; i <= n; i++) {
			ans = (ans + dp[n + 1][i]) % mod;
		}
		pw.println(ans);
		pw.close();
	}

	private static void getChoose(long[][] choose, int up, int dow) {
		// TODO Auto-generated method stub
		for (int i = 1; i < up; i++) {
			for (int j = 1; j <= i; j++) {
				if (j == 1 && i == 1) {
					choose[i][j] = 1;
				} else if (j == 1) {
					choose[i][j] = i;
				} else {
					choose[i][j] = (choose[i - 1][j] + choose[i - 1][j - 1]) % mod;
				}
			}
		}
	}

	private static void getPow(long[] power, int l) {
		// TODO Auto-generated method stub
		for (int i = 0; i < l; i++) {
			if (i == 0) {
				power[i] = 1;
			} else {
				power[i] = (power[i-1] * 2) % mod;
			}
		}
	}

}

//private static long getGCD(long l, long m) {
//// TODO Auto-generated method stub
//
//long t1 = Math.min(l, m);
//long t2 = Math.max(l, m);
//while (true) {
//	long temp = t2 % t1;
//	if (temp == 0) {
//		return t1;
//	}
//	t2 = t1;
//	t1 = temp;
//}
//}
// Problem: 1515_E. Phoenix and Computers
// Time complexity: cubic
import java.util.*;

public class Compute {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long M = sc.nextInt();
        long fact[] = new long[n+1];
        long inv[] = new long[n+1];
        long ifact[] = new long[n+1];
        long dp[][] = new long[n+1][n+1];
        fact[1] = 1;
        ifact[1] = 1;
        ifact[0] = 1;
        inv[1] = 1;
        dp[1][1] = 1;
        
        for(int i = 2; i <= n; i++) {
            fact[i] = (i*fact[i-1]) % M;
            inv[i] = (inv[(int)(M % i)]*(M - M/i)) % M;
            dp[i][i] = (dp[i-1][i-1] * 2) % M;
            ifact[i] = (ifact[i-1]*inv[i]) % M;
        }
            
        for(int i = 3; i <= n; i++) {
            for(int j = i/2 + 1; j <= i-1; j++) {
                for(int k = 2; k <= i-1 && j-k+1 > (i-k)/2; k++) {
                    dp[i][j] = (dp[i][j] + ((((dp[k-1][k-1]*dp[i-k][j-k+1] % M)*fact[j] % M)*ifact[k-1] % M)*ifact[j-k+1] % M)) % M;   
                }
            }   
        }
        
        long sum = 0;
        for(int i = n/2 + 1; i <= n; i++)
            sum = (sum + dp[n][i]) % M;
        
        System.out.println(sum % M);
    }
}
// Problem: 1515_E. Phoenix and Computers
// Time complexity: cubic
import java.io.*;
import java.util.*;

public class Main {
	static int m;
	static long pow(long b, int p) {
		long ret = 1;
		while (p > 0) {
			if ((p&1) == 1) ret = b*ret%m;
			b = b*b%m;
			p >>= 1;
		}
		return ret;
	}
	public static void main(String[] args) throws IOException {
		int n = readInt(); m = readInt();
		long[] fac = new long[n + 1], pow2 = new long[n + 1];
		long[][] C = new long[n + 1][n + 1], dp = new long[n + 1][n + 1];
		fac[0] = pow2[0] = 1;
		for (int i = 1; i <= n; ++i) {
			fac[i] = i*fac[i - 1]%m;
			pow2[i] = 2*pow2[i - 1]%m;
			for (int j = 0; j <= i; ++j)
				C[i][j] = fac[i]*(pow(fac[j], m - 2)*pow(fac[i - j], m - 2)%m)%m;
		}
		for (int i = 1; i <= n; ++i) {
			dp[i][i] = pow2[i - 1];
			for (int j = 0; j <= i; ++j)
				for (int k = 1; i + k + 1 <= n; ++k)
					dp[i + k + 1][j + k] = (dp[i + k + 1][j + k] + dp[i][j]*(C[j + k][k]*pow2[k - 1]%m))%m;
		}
		long ans = 0;
		for (int i = 1; i <= n; ++i)
			ans = (ans + dp[n][i])%m;
		System.out.println(ans);
	}
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static StringTokenizer st;
	static String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	static int readInt() throws IOException {
		return Integer.parseInt(next());
	}
}
// Problem: 1515_E. Phoenix and Computers
// Time complexity: cubic
import java.io.*;
import java.util.*;

public class E {

	public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

	public static void main(String[] args) throws IOException {
		readInput();
		out.close();
	}
	
	static long[][] dp;
	static int n;
	static long m;
	

	static long pow(long b, long e) {
		if (e== 0) return 1;
		long r= pow(b,e/2);
		r = r * r % m;
		if ((e&1)==1) return r *b%m;
		return r;
	}
	
	static long modinv(long a) {return pow(a,m-2);}
	
	static long solve(int len, int num) {
		if (len == -1 && num == -1) return 1;
		if (num < 0 || len <= 0) return 0;
		if (dp[len][num] == -1) {
			dp[len][num] = 0;
			for (int i = 0; i < len; i++) {
				if (i == 1) continue;
				long sol = pow[len-i-1]*solve(i-1,num-1)%m;
				sol = sol * faci[len-i]% m;
				dp[len][num] += sol;
				dp[len][num] %= m;
			}
			
		}
		return dp[len][num];
	}
	static long[] fac, faci, pow;
	//asdf
	public static void readInput() throws IOException {
		// br = new BufferedReader(new FileReader(".in"));
		// out = new PrintWriter(new FileWriter(".out"));
		StringTokenizer st = new StringTokenizer(br.readLine());
		n = Integer.parseInt(st.nextToken());
		m = Long.parseLong(st.nextToken());
		fac = new long[500];
		pow = new long[500];
		faci = new long[fac.length];
		fac[0] = pow[0] = 1;
		faci[0] = modinv(fac[0]);
		for (int i = 1; i < fac.length; i++) {
			fac[i] = fac[i-1]*i%m;
			faci[i] = modinv(fac[i]);
			pow[i] = pow[i-1] * 2 % m;
		}
		dp = new long[n+1][n+1];
		for (long[] a: dp) Arrays.fill(a, -1);
		// Number of ways to make a segment of length x is 2^(x-1)
		// DP: Given position I.
		long ans =0 ;
		for (int i = 0 ; i <= n/2+1; i++) {
			//System.out.println(i + ": " + solve(n,i) + " " + (n-i) + " " + (i));
			long sol = solve(n,i) * fac[n-i];
			sol %= m;
			ans += sol;
		}
		out.println(ans%m);
	}
}
// Problem: 1515_E. Phoenix and Computers
// Time complexity: cubic
import java.io.*;
import java.util.*;

public class E {

	public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

	public static void main(String[] args) throws IOException {
		readInput();
		out.close();
	}
	
	static long[][] dp;
	static int n;
	static long m;
	

	static long pow(long b, long e) {
		if (e== 0) return 1;
		long r= pow(b,e/2);
		r = r * r % m;
		if ((e&1)==1) return r *b%m;
		return r;
	}
	
	static long modinv(long a) {return pow(a,m-2);}
	
	static long solve(int len, int num) {
		if (len == -1 && num == -1) return 1;
		if (num < 0 || len <= 0) return 0;
		if (dp[len][num] == -1) {
			dp[len][num] = 0;
			for (int i = 0; i < len; i++) {
				if (i == 1) continue;
				long sol = pow[len-i-1]*solve(i-1,num-1)%m;
				sol = sol * faci[len-i]% m;
				dp[len][num] += sol;
				dp[len][num] %= m;
			}
			
		}
		return dp[len][num];
	}
	static long[] fac, faci, pow;
	
	public static void readInput() throws IOException {
		// br = new BufferedReader(new FileReader(".in"));
		// out = new PrintWriter(new FileWriter(".out"));
		StringTokenizer st = new StringTokenizer(br.readLine());
		n = Integer.parseInt(st.nextToken());
		m = Long.parseLong(st.nextToken());
		fac = new long[500];
		pow = new long[500];
		faci = new long[fac.length];
		fac[0] = pow[0] = 1;
		faci[0] = modinv(fac[0]);
		for (int i = 1; i < fac.length; i++) {
			fac[i] = fac[i-1]*i%m;
			faci[i] = modinv(fac[i]);
			pow[i] = pow[i-1] * 2 % m;
		}
		dp = new long[n+1][n+1];
		for (long[] a: dp) Arrays.fill(a, -1);
		// Number of ways to make a segment of length x is 2^(x-1)
		// DP: Given position I.
		long ans =0 ;
		for (int i = 0 ; i <= n/2+1; i++) {
			//System.out.println(i + ": " + solve(n,i) + " " + (n-i) + " " + (i));
			long sol = solve(n,i) * fac[n-i];
			sol %= m;
			ans += sol;
		}
		out.println(ans%m);
	}
}
// Problem: 35_C. Fire Again
// Time complexity: cubic
import java.io.*;
import java.util.*;
import java.math.*;



public class Main{
	
	public static void main(String[] Args) throws Exception {
	     Scanner sc = new Scanner(new FileReader("input.txt"));
	     int n,m,k;
	     Integer lx,ly;
	     boolean d[][];
	     n = sc.nextInt(); m = sc.nextInt(); k = sc.nextInt();
	     d = new boolean [n+1][m+1];
	     for(int i=0;i<=n;++i)
	      for(int j=0;j<=m;++j)
	       d[i][j]=false;
	     
	     Queue< pair > q = new LinkedList< pair >();
	     lx = ly = -1;
	     for(int i=0;i<k;++i){
	     	int x,y; x = sc.nextInt(); y = sc.nextInt();
	     	q.add(new pair(x,y)); lx = x; ly = y;
	     	d[x][y]=true;
	     }
	     
	     int dx [] = {0,0,1,-1};
	     int dy [] = {-1,1,0,0};
	     
	     
	     while(!q.isEmpty()){
	     	 pair tp = q.remove();
	     	 int x = tp.x; int y = tp.y;
	     	 for(int i=0;i<4;++i){
	     	 	 int nx = x+dx[i]; int ny = y+dy[i];
	     	 	 if(nx<1 || nx>n || ny<1 || ny>m || d[nx][ny] ) continue;
	     	     d[nx][ny]=true;
	     	     q.add(new pair(nx,ny));
	     	     lx = nx; ly = ny;
	     	 }
	     }
	     FileWriter fw = new FileWriter("output.txt");
	     fw.write(lx.toString()); fw.write(" "); fw.write(ly.toString());;
	     fw.flush();
	     	
	}
}
class pair {

  public int x,y;
  public pair(int _x,int _y){ x = _x; y = _y; }

}
// Problem: 35_C. Fire Again
// Time complexity: cubic
import java.util.*;
import java.io.*;

public class SolutionC{
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(new File("input.txt"));
		PrintWriter output = new PrintWriter("output.txt");
		int N = sc.nextInt();
		int M = sc.nextInt();
		int K = sc.nextInt();
		int[] x = new int[K];
		int[] y = new int[K];
		for(int i = 0 ; i < K ; i++){
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
		}
		int max = -1, max_x = -1, max_y = -1;
		for(int i = 1 ; i <= N ; i++){
			for(int j = 1 ; j <= M ; j++){
				int min = Integer.MAX_VALUE;
				for(int k = 0 ; k < K ; k++){
					min = Math.min(min, Math.abs(x[k] - i) + Math.abs(y[k] - j));
				}
				if(min > max){
					max = min;
					max_x = i;
					max_y = j;
				}
			}
		}
		output.println(max_x + " " + max_y);
		output.flush();
	}
}
// Problem: 35_C. Fire Again
// Time complexity: cubic
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
import java.awt.*;

public class PracticeProblem
{
    /*
     * This FastReader code is taken from GeeksForGeeks.com
     * https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
     *
     * The article was written by Rishabh Mahrsee
     */
    public static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() throws FileNotFoundException
        {
            br = new BufferedReader(new FileReader(new File("input.txt")));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static FastReader in;
    public static PrintWriter out;
    public static final int INF = Integer.MAX_VALUE;
    public static int n, m;

    public static final int[] dr = {-1, 0, 0, +1};
    public static final int[] dc = {0, -1, +1, 0};

    public static void main(String[] args) throws FileNotFoundException
    {
        in = new FastReader();
        out = new PrintWriter(new File("output.txt"));
        solve();
        out.close();
    }

    private static void solve()
    {
        n = in.nextInt();
        m = in.nextInt();
        int k = in.nextInt();

        int[][] timeToBurn = new int[n][m];
        for (int i = 0; i < n; i++)
            Arrays.fill(timeToBurn[i], INF);

        for (int i = 0; i < k; i++)
        {
            int r = in.nextInt() - 1;
            int c = in.nextInt() - 1;
            for (int j = 0; j < n; j++)
            {
                for (int l = 0; l < m; l++)
                {
                    timeToBurn[j][l] = min(timeToBurn[j][l], abs(r - j) + abs(c - l));
                }
            }
        }
        int max = -1;
        Point p = null;
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < m; j++)
            {
                if (timeToBurn[i][j] > max)
                {
                    max = timeToBurn[i][j];
                    p = new Point(i, j);
                }
            }
        }

        out.println((p.x + 1) + " " + (p.y + 1));
    }

}
// Problem: 35_C. Fire Again
// Time complexity: cubic
import java.util.*;
import java.io.*;

public class Main implements Runnable {
		
	public void solve() throws IOException {
		int N = nextInt();
                int M = nextInt();
                
                int B = nextInt();
                int[][] burn = new int[B][2];
                for(int i = 0; i < B; i++){
                        burn[i][0] = nextInt();
                        burn[i][1] = nextInt();
                }
                
                int ansx = -1;
                int ansy = -1;
                int ans = -1;
                
                for(int i = 1; i <= N; i++){
                        for(int j = 1; j <= M; j++){
                                int burnAt = Integer.MAX_VALUE;
                                for(int k = 0; k < B; k++){
                                        int now = distance(i, j, burn[k][0], burn[k][1]);
                                        burnAt = Math.min(burnAt, now);
                                }
                                //System.out.println(burnAt + " " + i + " " + j);
                                if(burnAt >= ans){
                                        
                                        ans = burnAt;
                                        ansx = i;
                                        ansy = j;
                                        
                                }
                        }
                }
                
                
                out.println(ansx + " " + ansy);
	}
        
        private int distance(int x, int y, int xx, int yy){
                //withour sqrt
                return Math.abs(xx - x) + Math.abs(yy - y);
        }

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------------------------------------------------
	public static void main(String[] args) {
		new Main().run();
	}

	public void run() {
		try {
			//in = new BufferedReader(new InputStreamReader(System.in));
			in = new BufferedReader(new FileReader(new File("input.txt")));
                        out = new PrintWriter(new FileWriter(new File("output.txt")));
                        tok = null;
			solve();
			in.close();
                        out.close();
		} catch (IOException e) {
			System.exit(0);
		}
	}

	public String nextToken() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

        PrintWriter out;
	BufferedReader in;
	StringTokenizer tok;
}
// Problem: 35_C. Fire Again
// Time complexity: cubic
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.Queue;

public class FireAgain {

	public static void main(String[] args) throws IOException {
		BufferedReader readData = new BufferedReader(new FileReader("input.txt"));
		PrintWriter writer = new PrintWriter(new File("output.txt"));
		String line = readData.readLine();
		String[] temp = line.split(" ");
		int n = Integer.valueOf(temp[0]);
		int m = Integer.valueOf(temp[1]);
		int x = 0, y = 0;
		line = readData.readLine();
		int k = Integer.valueOf(line);
		boolean[][] visited = new boolean[n + 1][m + 1];
		Queue<Integer> qX = new LinkedList<Integer>();
		Queue<Integer> qY = new LinkedList<Integer>();
		line = readData.readLine();
		String[] temp2 = line.split(" ");
		for (int i = 0; i < temp2.length - 1; i+=2) {
			x = Integer.valueOf(temp2[i]);
			y = Integer.valueOf(temp2[i + 1]);
			visited[x][y] = true;
			qX.add(x);
			qY.add(y);
		}

		while (!qX.isEmpty()) {
			x = qX.poll();
			y = qY.poll();
			if (x >= 2 && !visited[x - 1][y]) {
				visited[x - 1][y] = true;
				qX.add(x - 1);
				qY.add(y);
			}
			if (x + 1 <= n && !visited[x + 1][y]) {
				visited[x + 1][y] = true;
				qX.add(x + 1);
				qY.add(y);
			}
			if (y >= 2 && !visited[x][y - 1]) {
				visited[x][y - 1] = true;
				qX.add(x);
				qY.add(y - 1);
			}
			if (y + 1 <= m && !visited[x][y + 1]) {
				visited[x][y + 1] = true;
				qX.add(x);
				qY.add(y + 1);
			}
		}
		writer.write(x + " ");
		writer.write(y + " ");
		writer.close();
	}

}
// Problem: 35_C. Fire Again
// Time complexity: cubic
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new FileReader(new File("input.txt")));
		PrintWriter pw = new PrintWriter(new File("output.txt"));

		StringTokenizer st;

		st = new StringTokenizer(in.readLine());
		
		int n = Integer.parseInt(st.nextToken()),
			m = Integer.parseInt(st.nextToken()),
			k = Integer.parseInt(in.readLine());
		
		int[][] A = new int[n][m];
		
		st = new StringTokenizer(in.readLine());
		for (int i = 0 ; i < k ; i++) {
			int x1 = Integer.parseInt(st.nextToken()) - 1,
				y1 = Integer.parseInt(st.nextToken()) - 1;
			
			A[x1][y1] = -10000000;
			
			for (int j = 0 ; j < n ; j++) {
				for (int g = 0 ; g < m ; g++) {
					if (A[j][g] == 0 || (A[j][g] > (Math.abs(y1 - g) + Math.abs(x1 - j)))) {
						A[j][g] = (Math.abs(y1 - g) + Math.abs(x1 - j));
					}
				}
			}
		}
		
		int f = 0, h = 0;
		
		for (int i = 0 ; i < n ; i++) {
			for (int j = 0 ; j < m ; j++) {
				if (A[i][j] != -10000000) {
					f = i;
					h = j;
				}
			}
		}
		
		for (int i = 0 ; i < n ; i++) {
			for (int j = 0 ; j < m ; j++) {
				if (A[i][j] > A[f][h] && A[i][j] != -10000000) {
					f = i;
					h = j;
				}
			}
		}
	//	for (int i = 0 ; i < n ; i++) for (int j = 0 ; j < m ; j++) System.out.println(A[i][j]);
		pw.println((f + 1) + " " + (h + 1));
		pw.close();
	}
}
// Problem: 35_C. Fire Again
// Time complexity: cubic
import java.io.*;
import java.util.*;

public class C35C_BFS_Fire {
    public static boolean[][] burning;
    public static LinkedList<int[]> LitTrees; //which is best to use
    public static int N, M;
    public static int[] lastTree;
    public static void main(String[] args) throws IOException {
        // InputStreamReader stream = new InputStreamReader(System.in);
        // BufferedReader input = new BufferedReader(stream);

        BufferedReader input = new BufferedReader(new FileReader("input.txt"));
		PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));

        StringTokenizer dataR = new StringTokenizer(input.readLine());
        N = Integer.parseInt(dataR.nextToken());
        M = Integer.parseInt(dataR.nextToken());
        burning = new boolean[N+1][M+1];

        StringTokenizer dataR1 = new StringTokenizer(input.readLine());
        int K = Integer.parseInt(dataR1.nextToken());

        StringTokenizer dataR2 = new StringTokenizer(input.readLine());
        LitTrees = new LinkedList<int[]>();
        for (int j = 0; j < K; j++){
            int x = Integer.parseInt(dataR2.nextToken());
            int y = Integer.parseInt(dataR2.nextToken());
            int[] coord = {x, y};
            LitTrees.add(coord);
            burning[x][y] = true;
        }

        spread();

        out.println(lastTree[0] + " " + lastTree[1]);
        out.close();

    }

    public static void spread(){
        while(!LitTrees.isEmpty()){
            int[] studying = LitTrees.remove(); //is iterator faster
            LinkedList<int[]> ll = new LinkedList<int[]>();

            if(studying[0]-1 >= 1) ll.add(new int[]{studying[0]-1, studying[1]});
            if(studying[1]-1 >= 1) ll.add(new int[]{studying[0], studying[1]-1});
            if(studying[1]+1 < M+1) ll.add(new int[]{studying[0], studying[1]+1});
            if(studying[0]+1 < N+1) ll.add(new int[]{studying[0]+1, studying[1]});

            while(!ll.isEmpty()) {
                int[] focus = ll.remove();
                if(!burning[focus[0]][focus[1]]) {
                    LitTrees.add(focus);
                    burning[focus[0]][focus[1]] = true;
                }
            }

            lastTree = studying; 
        }        
    }
    
}