import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String s=sc.next(); int[]a=new int[26]; for (int i = 0; i < s.length(); i++) { a[s.charAt(i)-'0'-49]++; } int max=0,min=100; for (int i =0; i < a.length; i++) { if(a[i]>0){ if(a[i]>max)max=a[i]; if(a[i]<min)min=a[i]; } } if(ispri(max-min)) System.out.println("Lucky Word\n"+(max-min)); else System.out.println("No Answer\n"+0); } static boolean ispri(int n){ if(n<2) return false; for (int i = 2; i <=Math.sqrt(n); i++) { if(n%i==0) return false; } return true; } }
0.0分
1 人评分