Add a Java program for 1277