/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
// your code goes here
String line
= "C3H20ZnO2ABCD"; String pattern
= "([A-Z][a-z]*)(((?=[A-Z][a-z]*|$))|\\d+)";
// Create a Pattern object
Pattern r = Pattern.compile(pattern);
// Now create matcher object.
Matcher m = r.matcher(line);
while (m.find( )) {
if (m.group(2).length() == 0) {
} else {
System.
out.
println(" " + m.
group(2)); }
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguTWF0Y2hlcjsKaW1wb3J0IGphdmEudXRpbC5yZWdleC5QYXR0ZXJuOwoKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCgkJU3RyaW5nIGxpbmUgPSAiQzNIMjBabk8yQUJDRCI7CiAgICAgIFN0cmluZyBwYXR0ZXJuID0gIihbQS1aXVthLXpdKikoKCg/PVtBLVpdW2Etel0qfCQpKXxcXGQrKSI7CgogICAgICAvLyBDcmVhdGUgYSBQYXR0ZXJuIG9iamVjdAogICAgICBQYXR0ZXJuIHIgPSBQYXR0ZXJuLmNvbXBpbGUocGF0dGVybik7CgogICAgICAvLyBOb3cgY3JlYXRlIG1hdGNoZXIgb2JqZWN0LgogICAgICBNYXRjaGVyIG0gPS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