RoAlgo Contest #7 | cuvinte

This was the problem page during the contest. Access the current page here.
Time limit: 0.05s Memory limit: 64MB Input: Output:

The following functions are defined:

• $reverse(s)$: reverses the string $s$;
• $order(s)$: rearranges the letters of the string $s$ in alphabetical order;
• $concat(s_1,s_2)$: concatenates all the vowels in the word $s_2$ to the vowels in the word $s_1$, in order;
• $substr(s,x,y,p)$: extracts the substring located between positions $x$ and $y$ in the word $s$ by stepping $p$ positions at a time starting from position $x$, $1 \leq x \leq y \leq strlen(s)$.

Examples:

• $reverse("hello")$: "olleh";
• $order("hello")$: "ehllo";
• $concat("hello", "world")$: "eoo";
• $substr("helloworld", 2, 9, 3)$: "eor";

Evaluate an expression composed of calls to these functions.

Input data

The first line of the input contains the expression to be evaluated.

Output data

The first line contains the result of the evaluation, enclosed in double quotes $" "$.

Constraints and clarifications

• $1 \leq strlen(expression) \leq 30\ 000$;
• $1 \leq strlen(s) \leq 100$, for any word $s$;
• In the tests, all words $s$ are enclosed in double quotes $" "$.

Example 1

stdin

"helloworld"


stdout

"helloworld"


Explanation

There are no operations to perform.

Example 2

stdin

reverse(order(concat("hello",substr("world",1,5,1))))


stdout

"ooe"


Explanation

$substr("world",1,5,1)$: "world"
$concat("hello",substr("world",1,5,1))$: "eoo"
$order(concat("hello",substr("world",1,5,1)))$: "eoo"
$reverse(order(concat("hello",substr("world",1,5,1))))$: "ooe"