import java.util.*;
import java.util.regex.*;
import java.lang.*;
import java.io.*;
class Ideone {
String input
= "w ww www wwww wwwww wwwwwww wwwwww aaa bbb zzzzzz cccc"; Pattern pattern = Pattern.compile("\\b\\w{3,5}\\b");
Matcher matcher = pattern.matcher(input);
int count = 0;
while (matcher.find()) {
count++;
}
count -= count % 2;
String result
= String.
join("",
(CharSequence
[]) pattern.
split(input, count
+ 1)); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS51dGlsLnJlZ2V4Lio7CmltcG9ydCBqYXZhLmxhbmcuKjsKaW1wb3J0IGphdmEuaW8uKjsKCmNsYXNzIElkZW9uZSB7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24gewoJCVN0cmluZyBpbnB1dCA9ICJ3IHd3IHd3dyB3d3d3IHd3d3d3IHd3d3d3d3cgd3d3d3d3IGFhYSBiYmIgenp6enp6IGNjY2MiOwogICAgICAgIFBhdHRlcm4gcGF0dGVybiA9IFBhdHRlcm4uY29tcGlsZSgiXFxiXFx3ezMsNX1cXGIiKTsKICAgICAgICBNYXRjaGVyIG1hdGNoZXIgPSBwYXR0ZXJuLm1hdGNoZXIoaW5wdXQpOwogICAgICAgIGludCBjb3VudCA9IDA7CiAgICAgICAgd2hpbGUgKG1hdGNoZXIuZmluZCgpKSB7CiAgICAgICAgICAgIGNvdW50Kys7CiAgICAgICAgfQogICAgICAgIGNvdW50IC09IGNvdW50ICUgMjsKICAgICAgICBTdHJpbmcgcmVzdWx0ID0gU3RyaW5nLmpvaW4oIiIsIChDaGFyU2VxdWVuY2VbXSkgcGF0dGVybi5zcGxpdChpbnB1dCwgY291bnQgKyAxKSk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKHJlc3VsdCk7Cgl9Cn0=