// Program 75: Composite Magic Number import java.util.*; class CompositeMagic { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if (n < 2) { System.out.println("INVALID INPUT"); return; } int factors = 0; for (int i = 1; i <= n; i++) { if (n % i == 0) { factors++; } } int x = n; while (x > 9) { int sum = 0; while (x > 0) { sum += x % 10; x /= 10; } x = sum; } System.out.println(factors > 2 && x == 1 ? "COMPOSITE MAGIC NUMBER" : "NOT A COMPOSITE MAGIC NUMBER"); } }