403530: GYM101191 C Ancient CBS

Memory Limit:64 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Ancient CBStime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output

During excavations in one of the caves archaeologists were discovered ancient inscriptions. Each of the records found was a certain number N and correct bracket sequence (CBS).

Recall that the CBS can be defined as follows:

  • empty string is the CBS;
  • if S is a CBS, then (S) is also a CBS;
  • if S1 and S2 are CBS, then S1S2 is the CBS.

According to some of the records, archaeologists realized that the first number is the number of substrings in the CBS, which are also the CBS. This led archaeologists to believe that if they restore the remaining inscriptions, they will be available for some secret knowledge. Since the walls of the cave mainly found numbers, then they believe that the recovery of the missing CBS possible. The researchers also found that the length of each of the CBS should not exceed 105 characters, because it can not fit on the wall in the cave.

Accordingly, now they need to build such a CBS, which contains exactly N substrings, which are also the CBS.

Input

Single line contains a positive integer N — the number of substring in the CBS, which are also CBS (1 ≤ N ≤ 109).

Output

CBS, which contains exactly N substring being CBS. The length of the output string must not exceed 105 characters.

ExamplesInput
2
Output
(())

加入题单

上一题 下一题 算法标签: