import java.io.;
import java.util.;
public class Solution {
public static void dup(String str,int i,String ans)
{
if(i==str.length())
System.out.println(ans);
if(str.charAt(i)==str.charAt(i+1))
{
char st=str.charAt(i);
dup( str,i+2, ans+st);
}
else{
char st=str.charAt(i);
dup(str,i+1,ans+st);
}
}
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
String a=s.nextLine();
dup(a,0," ");
}
}
how can we remove out of bound exception while comparing with next element ?