public String generateTheString(int n) {
int count = (n % 2 == 0) ? n - 1 : n;
StringBuilder result = new StringBuilder();
result.append("x".repeat(Math.max(0, count)));
if( n % 2 == 0){
result.append('y');
}
return result.toString();
}