import java.util.Scanner;
public class Main{
public static boolean Judge(String temp){
int length = temp.length();
boolean [] symbols = new boolean[4];
for(int i=0;i<length;i++){
char tempChar = temp.charAt(i);
if(tempChar <= 'Z' && tempChar >= 'A'){
symbols[0] = true;
}else{
if(tempChar <= 'z' && tempChar >= 'a'){
symbols[1] = true;
}
else{
if(tempChar <= '9' && tempChar >= '0'){
symbols[2] = true;
}
else{
if(tempChar!=' '){
symbols[3] = true;
}
}
}
}
if(symbols[0] && symbols[1] && symbols[2] && symbols[3]){
return true;
}
}
if(symbols[0] && symbols[1] && symbols[2] && symbols[3]){
return true;
}else{
return false;
}
}
public static void main(String []args){
Scanner in = new Scanner(System.in);
String inString = in.nextLine();
char[] tempChar = inString.toCharArray();
char[] finalChar = new char[tempChar.length];
// 存储去除退格后的字符串 被去除的地方填默认值'\u0000'
StringBuffer returnString = new StringBuffer("");
// 存储最后要检验的字符串
for(int i=0;i<tempChar.length;i++){
if(tempChar[i]=='<'){
finalChar[i] = '\u0000';
// 当前字符是'<' 则当前字符置空
if(i>=1){
// 左侧还能访问
int t = i-1;
// 向左循环 淘汰那些 空白值 \u0000 但是要注意 t>0
// 当 t==0 的时候跳出循环
// 把从右向左的第一个不是空白值的元素退格成空白值
while(finalChar[t]=='\u0000' && t>0){
t--;
// 跳出时 的 t 满足数组上下界
}
finalChar[t] = '\u0000';
}
}
else{
finalChar[i] = tempChar[i];
}
}
for(char temp:finalChar){
if(temp!='\u0000'){
returnString.append(temp);
System.out.print(temp);
}
}
// 输出
System.out.print(",");
if(returnString.length()<8){
System.out.print(false);
}
else{
String returnStringTemp = returnString.toString();
if(Judge(returnStringTemp)){
System.out.print(true);
}
else{
System.out.print(false);
}
}
/*for(char temp:finalChar){
System.out.println(temp=='\u0000');
// 输出打印true
}*/
}
}