lab 4 Java, variant 19