public static void main(String[] args) throws IOException {
		long inicio = System.currentTimeMillis();
		StringBuilder out = new StringBuilder();
		BufferedReader in;
		File archivo = new File("entrada");
		if (archivo.exists())
			in = new BufferedReader(new FileReader(archivo));
		else
			in = new BufferedReader(new InputStreamReader(System.in));

		String line = "";
		int times = 0;
		char cad[];
		int k = 0;
		SuffixArrayClass suffix = new SuffixArrayClass();
		while ((line = in.readLine()) != null) {
			if (times++ > 0) {
				out.append("\n");
				line = in.readLine();
			}
			k = line.length();
			line = line + "$" + in.readLine() + "#";
			cad = line.toCharArray();
			suffix.init(cad);
			suffix.construct();
			suffix.lpc();
			ArrayList<String> res = suffix.LCS(k, line);
			if (res.size() == 0 || (res.size() == 1 && res.get(0).equals("")))
				out.append("No common sequence.\n");
			else
				for (int i = 0; i < res.size(); i++) {
					out.append(res.get(i) + "\n");
				}

			// print(suffix.sA);

		}
		System.out.print(out);
		if (archivo.exists())
			System.out.println("Tiempo transcurrido : "
					+ (System.currentTimeMillis() - inicio) + " milisegundos.");
	}