Position Of Brackets

easy
1. Given an expression exp of length n consisting of some brackets. 
  2. The task is to print the bracket numbers when the expression is being parsed.    
  3. Bracket number is position of bracket pair to which the current bracket belongs.

Input Format

A string

Output Format

Bracket number for each bracket encountered while parsing the string.

Constraints

1<=S<=100

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
(a+(b*c))+(d/e)
Output
1 2 2 1 3 3
Previous
Unique Character
Next
Last Occurrence Of An Item

Related Questions