public class Enthalten
{
    public static void main(String[] args)
    {
	int i,j,k;
	boolean enthalten;
	String s,t;

	for (i=10; i<=1000; i++)
	{
	    for (j=i; j<=1000; j++)
	    {
		enthalten=false;
		s = Integer.toString(j);
		t = Integer.toString(i);

		for (k=0; k<=s.length()-t.length(); k++)
		{
		    if (s.substring(k,k+t.length()).equals(t))
		    {
			enthalten=true;
		    }
		}
		if ( enthalten )
		{
		    System.out.print("(" + i + "," + j + ") ");
		}
	    }
	}
    }
}
