import java.util.*;
import java.util.regex.*;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String s = "Ca(OH)2";
		Pattern p = Pattern.compile("\\([A-Za-z0-9]+\\)[0-9]*|[A-Za-z0-9]+");
	    Matcher m = p.matcher(s);
	    List<String> res = new ArrayList<>();
	    while(m.find()) {
	    	res.add(m.group());
	    }
	    System.out.println(res);
	}
}