// Program 78: Snowball String import java.util.*; class SnowballString { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine().trim().replaceAll("[.?!]$", ""); String[] words = s.split("\\s+"); boolean ok = true; for (int i = 1; i < words.length; i++) { if (words[i].length() != words[i - 1].length() + 1) { ok = false; } } System.out.println(ok ? "SNOWBALL STRING" : "NOT A SNOWBALL STRING"); } }