import java.util.*;
public class CheckBlurb
{
static int count = 0;
public static void main(String[] args)
{
String userInput;
Scanner scan = new Scanner(System.in);
System.out.println("Enter a blurb.");
userInput = scan.next();
boolean isValid;
int checkStart = isWhoozit(userInput);
if(checkStart == 0)
{
isValid = false;
}
else
{
String nextCheck = (userInput.substring(checkStart));
isValid = isWhatzit(nextCheck);
}
if(isValid == true)
{
System.out.println("Yep, that is a Blurb.");
}
else
{
System.out.println("Nope, not a Blurb, sorry.");
}
}
public static int isWhoozit(String str)
{
if(str.charAt(count) == 'x')
{
count ++;
while(str.charAt(count) == 'y')
{
count++;
}
}
else
{
count = 0;
}
return count;
}
public static boolean isWhatzit(String str)
{
if(str.substring(0,1) != "qd" || str.substring(0,1) != "qz")
{
return false;
}
str = str.substring(2);
int nextWhoozit = isWhoozit(str);
if (nextWhoozit == 0)
{
return false;
}
else if (nextWhoozit >= str.length())
{
return true;
}
else
{
return isWhatzit(str.substring(nextWhoozit));
}
}
}