import java.io.*; import java.math.*; public class C_kosak_2 { public static void main(String pArgs[]) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while (solve(in, System.out)) ; in.close(); } private static boolean solve(BufferedReader pIn, PrintStream pOut) throws IOException { String line; int index, width, height; char[][] matrix; // 行列のサイズを読む line = pIn.readLine(); index = line.indexOf(' '); width = Integer.parseInt(line.substring(0, index)); height = Integer.parseInt(line.substring(index + 1)); if (width == 0 && height == 0) return false; matrix = new char[height][width]; // 行列を読む for (int h = 0; h < height; h++) { line = pIn.readLine(); for (int w = 0; w < width; w++) matrix[h][w] = line.charAt(w); } // 表を作成 BigInteger[][] table = new BigInteger[height + 1][width + 1]; BigInteger biggest = null; char chr; for (int h = 0; h <= height; h++) table[h][0] = BigInteger.ZERO; for (int w = 0; w <= width; w++) table[0][w] = BigInteger.ZERO; for (int h = 1; h <= height; h++) { for (int w = 1; w <= width; w++) { chr = matrix[h - 1][w - 1]; if (chr >= '0' && chr <= '9') { if (table[h - 1][w].compareTo(table[h][w - 1]) > 0) table[h][w] = new BigInteger(table[h - 1][w].toString() + chr); else table[h][w] = new BigInteger(table[h][w - 1].toString() + chr); if (biggest == null || table[h][w].compareTo(biggest) > 0) biggest = table[h][w]; } else table[h][w] = BigInteger.ZERO; } } pOut.println(biggest == null ? "No secrets..." : biggest.toString()); return true; } // solve } // class C_kosak_2