cuvinte

Time limit: 0.05s Memory limit: 64MB Input: Output:

"E ușor a scrie versuri,
Când nimic nu ai a spune,
Înșirând cuvinte goale
Ce din coadă au să sune."

Se consideră următoarea listă de funcții definite astfel:

  • reverse(s)reverse(s): inversează cuvăntul ss;
  • order(s)order(s): schimbă ordinea literelor cuvăntului ss astfel încât literele să fie ordonate alfabetic;
  • concat(s1,s2)concat(s_1,s_2): lipește toate vocalele cuvântului s2s_2 la vocalele cuvântului s1s_1, în ordine;
  • substr(s,x,y,p)substr(s,x,y,p): extrage subșirul aflat între pozițiile xx și yy în cuvântul ss mergând din pp în pp (începând de la poziția xx), 1xystrlen(s) 1 \leq x \leq y \leq strlen(s).

Exemple:

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

Cerință

Se cere să se evalueze o expresie formată din apeluri ale acestor funcții.

Date de intrare

Pe prima linie se va afla expresia de evaluat.

Date de ieșire

Pe prima linie se va afișa rezultatul obținut în urma evaluării, între """ ".

Restricții și precizări

  • 1strlen(expresie)30 0001 \leq strlen(expresie) \leq 30 \ 000;
  • 1strlen(s)1001 \leq strlen(s) \leq 100, pentru orice cuvânt ss;
  • În teste, toate cuvintele ss sunt puse între """ ";

Exemplul 1

stdin

"helloworld"

stdout

"helloworld"

Explicație

Nu există prelucrări de efectuat.

Exemplul 2

stdin

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

stdout

"ooe"

Explicație

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

Log in or sign up to be able to send submissions!