CPython lite logoProblemsContests

2025. HTML editor

The admin has created a simple HTML editor to simplify writing the conditions of the problem. In this editor, the text is entered using special characters.

The set of operators is limited:

  • Headings (start with =)
  • Lists of the same level (start with ()
  • Paragraphs - links (formatted in two brackets)

Your task is to implement the capabilities of the editor, or more precisely, to write an algorithm that converts the source text into HTML markup.


Input

An unspecified number of lines contains the original text. The total length of the text does not exceed 1000 .

Output

Output text converted to HTML.


Sample input 1

* kep

Sample output 1

<ul><li>kep</li></ul>

Sample input 2

* kep1
* kep2

Sample output 2

<ul><li>kep1</li><li>kep2</li></ul>

Sample input 3

* kep1

* kep2

Sample output 3

<ul><li>kep1</li></ul><ul><li>kep2</li></ul>

Sample input 4

kep

Sample output 4

<p>kep</p>

Sample input 5

= head

text ((https://kep.uz link)) text.

* kep1
* kep2

Sample output 5

<h1>head</h1>
<p>text <a href="https://kep.uz">link</a> text.</p>
<ul><li>kep1</li><li>kep2</li></ul>

Login to be able to submit.

Problem
A 65
B1 60
B2 20
C 3
D 36
E1 36
E2 18
F 14
G 3
H 2
I 0
J 2
MediumHTMLParsingStrings
6 / 10
Solved / unsolved count
1.0 s / 256 MB
Limits