import java.util.*;

public class Main {

    public static void main(String[] args) {
	    int numberOne = 100;
        int numberTwo = 100;
        ArrayList<Integer> list = new ArrayList<Integer>(); //list for holding the results

        while(numberOne != 1000){
            int product = numberOne * numberTwo;
            if (String.valueOf(product).equals(new StringBuilder(String.valueOf(product)).reverse().toString())){ //is a number a palindrome?
                list.add(product);
            }
            numberTwo++;
            if (numberTwo == 999){
                numberTwo = 100;
                numberOne++;
            }
        }
        System.out.println(Collections.max(list)); //getting the max number
        for(int i = 0; i < list.size(); i++){
            System.out.println(list.get(i)); //and let's get all of them too
        }
    }
}
