Consecutive 1-Bits are Incremented Given a pattern (string or array format) of Bits :
[0,1,1,1,0,1,1,0,0,0,1,1,1,1,1,1] 

The tasks is to replace any number of consecutive 1-Bits with an ascending number sequence starting at 1.

Input


Pattern (can be received as an string or array) Example:


String: 1001011010110101001
Array: [1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1]



Output


Ascending number sequence (can be returned as an string or array) Example: 


String: 1 0 0 1 0 1 2 0 1 0 1 2 0 1 0 1 0 0 1
Array: [1, 0, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 0, 1, 0, 1, 0, 0, 1]



Rules


(only apply for strings) Input wont contain spaces between 1 and 0
Assume Input length &gt; 0
(only apply for strings) Output is separated by space (use any other separator if you need as long as is not a number or a letter from the alphabet)


Example: 

Given [0,1,1,1,0,1,1,0,0,0,1,1,1,1,1,1] 
Output [0,1,2,3,0,1,2,0,0,0,1,2,3,4,5,6]

--------------------------------------------------------------------------

Given 0110101111101011011111101011111111     
Output 0 1 2 0 1 0 1 2 3 4 5 0 1 0 1 2 0 1 2 3 4 5 6 0 1 0 1 2 3 4 5 6 7 8

---------------------------------------------------------------------------

Given 11111111111101    
Output 1 2 3 4 5 6 7 8 9 10 11 12 0 1




Winning criteria: Codegolf
05AB1E, 4 bytes

γ€ƶ˜


Try it online!
or as a Test Suit

Explanation

γ      # split input into groups of consecutive equal elements
 €ƶ    # multiply each number in each sublist by its 1-based index in the sublist
   ˜   # flatten