import java.util.regex.*;
class L
{
public static void main(String args[])
{
checkTel();
}
public static void checkTel()
{
String str="我我。。。。。我要。。。。要要学。。。。学";
str=str.replaceAll("\\。+","");
System.out.println(str);
str=str.replaceAll("(.)\\1+","$1");
System.out.println(str);
}
}