import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
// 标准输入
Scanner input = new Scanner(System.in);
// 获取密码字符串
String password = input.nextLine();
// 调用评级函数对密码进行安全等级划分
String grade = checkGrade(password);
// 输出安全评价等级
System.out.println(grade);
}
private static String checkGrade(String password) {
// 创建辅助变量
int pwdScore = 0; // 密码评分
int pwdLen; // 密码长度
int digitCount = 0; // 数字个数
int symbolCount; // 符号个数
boolean isUpLetter = false; // 是否有大写字母
boolean isLowLetter = false; // 是否有小写字母
// 分部分对密码进行评分
// 1.长度评分
pwdLen = password.length();
if (pwdLen <= 4) {
pwdScore += 5; // 长度在0~4之间
} else if (pwdLen <= 7) {
pwdScore += 10; // 长度在5~7之间
} else {
pwdScore += 25; // 长度大于等于8
}
// 2.字母评分
for (char c : password.toCharArray()) { // 统计大小写字母存在状态
if (!isUpLetter) { // 尚未发现大写字母
isUpLetter = Character.isUpperCase(c);
}
if (!isLowLetter) { // 尚未发现小写字母
isLowLetter = Character.isLowerCase(c);
}
} // 字母状态统计完毕
if (isUpLetter && isLowLetter) {
pwdScore += 20; // 大小写字母都有
} else if (isUpLetter || isLowLetter) {
pwdScore += 10; // 只有一种字母
} // 没有字母
// 3.数字评分
for (char c : password.toCharArray()) {
if (Character.isDigit(c)) {
digitCount++; // 当前字符为数字
}
}
if (digitCount > 1) {
pwdScore += 20; // 数字大于一个
} else if (digitCount == 1) {
pwdScore += 10; // 数字等于一个
} // 没有数字
// 4.符号评分
String newPassword = password.replaceAll("[A-Za-z\\d]", "");
symbolCount = newPassword.length();
if (symbolCount > 1) {
pwdScore += 25; // 符号大于一个
} else if (symbolCount == 1) {
pwdScore += 10; // 符号等于一个
} // 没有符号
// 5.奖励部分
// 创建奖励部分专用的辅助变量
boolean isLetter = isUpLetter || isLowLetter; // 是否有字母
boolean isDigit = digitCount > 0; // 是否有数字
boolean isSymbol = symbolCount > 0; // 是否有符号
// 发放奖励
if (isUpLetter && isLowLetter && isDigit && isSymbol) {
pwdScore += 5; // 大小写字母、数字和符号都有
} else if (isLetter && isDigit && isSymbol) {
pwdScore += 3; // 有一种字母、数字和符号
} else if (isLetter && isDigit) {
pwdScore += 2; // 有一种字母和数字
} // 不满足以上条件
// 密码评分完毕,按评分输出结果
if (90 <= pwdScore) {
return "VERY_SECURE";
} else if (80 <= pwdScore) {
return "SECURE";
} else if (70 <= pwdScore) {
return "VERY_STRONG";
} else if (60 <= pwdScore) {
return "STRONG";
} else if (50 <= pwdScore) {
return "AVERAGE";
} else if (25 <= pwdScore) {
return "WEAK";
} else if (0 <= pwdScore) {
return "VERY_WEAK";
} else {
return "FUCK_YOU";
}
}
}