/* package whatever; // don't place package name! */

import java.util.*;
import java.util.regex.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{

    private static void test(String s) {
    	Pattern p = Pattern.compile("((?:sin|cos|tan|cot|sec|csc)(?:h)?)\\s*(?:[\\^](\\d+)\\s*)?(?:((?<=\\s|\\()[a-z0-9]+)|[(]((?<=\\s|\\()[a-z0-9]+)[)])");
		Matcher m = p.matcher(s);
		if (m.find()) {
			for(int i = 1 ; i <= m.groupCount() ; i++ ) {
				System.out.println(m.group(i));
			}
		}
		System.out.println("----");
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		test("sinh^3(h)");
		test("sinh h");
		test("sin(h)");
		test("sinh(h)");
	}
}