/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Pattern p = Pattern.compile("aa");
Matcher m = p.matcher("aabbccaahhhaahhhaaahahhahaaakty");
int i = 0;
while (m.find()) {
m.appendReplacement(sb, ""+(i++));
}
m.appendTail(sb);
System.
out.
println(sb.
toString());
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguKjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJClBhdHRlcm4gcCA9IFBhdHRlcm4uY29tcGlsZSgiYWEiKTsKTWF0Y2hlciBtID0gcC5tYXRjaGVyKCJhYWJiY2NhYWhoaGFhaGhoYWFhaGFoaGFoYWFha3R5Iik7ClN0cmluZ0J1ZmZlciBzYiA9IG5ldyBTdHJpbmdCdWZmZXIoKTsKaW50IGkgPSAwOwp3aGlsZSAobS5maW5kKCkpIHsKICAgIG0uYXBwZW5kUmVwbGFjZW1lbnQoc2IsICIiKyhpKyspKTsKfQptLmFwcGVuZFRhaWwoc2IpOwpTeXN0ZW0ub3V0LnByaW50bG4oc2IudG9TdHJpbmcoKSk7CgkJCgkJCgl9Cn0=