1. JAVA, Simon Baumgartner

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/*
* ACM Programming Contest
* Problem: 10100 Longest Match
* Status: Wrong Answer
* Runtime: 0.128
* Date: 2009-05-29
* Author: Simon Baumgartner
*
*/

public class Main {

public static void main(String[] args) throws IOException {
// BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
BufferedReader in = new BufferedReader(new FileReader("input.txt"));
int count = 0;

while(in.ready()){

String master = in.readLine();
String input = in.readLine();

master = master.replaceAll("[^a-zA-Z0-9]", " ");
input = input.replaceAll("[^a-zA-Z0-9]", " ");

String[] masterWords = master.split(" ");
String[] inputWords = input.split(" ");
String msg = "";

if(masterWords.length == 0 || inputWords.length == 0){
msg = "Blank!";
}else{

int[] indizes = new int[inputWords.length];
for(int i = 0; i < inputWords.length; i++)
for(int j = 0; j < masterWords.length; j++)
if(inputWords[i].equals(masterWords[j]))
indizes[i] = j;

int[] v = new int[indizes.length];
Arrays.fill(v, 1);
for(int i = 1; i < indizes.length; i++){
for(int j = 0; j < i; j++){
// if this is the correct order
if(indizes[j] < indizes[i] && v[j] + 1 > v[i]){
v[i] = v[j] + 1;
}
}
}
Arrays.sort(v);
msg = "Length of longest match: " + v[v.length-1];
}

if(count <= 9)
System.out.println(count + ". " + msg);
else
System.out.println(count + "." + msg);

count++;
}
}

}