Program to find the number repeating maximum using classes