Hello CodinGame community!

I am struggling a little bit with this puzzle but feel like I am getting closer to a solution. If anyone could look at this and provide a nudge forward, it would be greatly appreciated. I am unable to print results and keep getting a “timeout” error message.

```
import java.util.*;
import java.io.*;
import java.math.*;
/**
* Don't let the machines win. You are humanity's last hope...
**/
class Player {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int width = in.nextInt(); // the number of cells on the X axis
int height = in.nextInt(); // the number of cells on the Y axis
if (in.hasNextLine()) {
in.nextLine();
}
String result = "";
String result1= "";
String result2 = "";
char[][] grid = new char [width][height];
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++){
String line = in.nextLine(); // width characters, each either 0 or .
char c = line.charAt(grid [i][j]);
if(c == '0'){
result = String.valueOf(c);
if(c == '.'){
result = "-1, -1";
continue;
}
}
for(int k = i + 1; k < height; k++){
line = in.nextLine();
char b1 = line.charAt(grid[k][j]);
if(b1 == '0'){
result1 = String.valueOf(b1);
if(b1 == '.'){
result = "-1, -1";
continue;
}
}
}
for(int m = j + 1; m < height; j++){
line = in.nextLine();
char r1 = line.charAt(grid[i][m]);
if(r1 == '0'){
result2 = String.valueOf(r1);
if(r1 == '.'){
result = "-1, -1";
continue;
}
}
}
}
System.out.println(result + "" + result1 + "" + result2);
}
}
}
```