#agc053a. [agc053_a]>< again

[agc053_a]>< again

Problem Statement

We have a string SS of length NN, where each character is < or >.

A non-negative integer sequence of N+1N+1 elements, X0,X1,ldots,XNX_0,X_1,\\ldots,X_N, is said to be good when it satisfies the following for every 1leqileqN1 \\leq i \\leq N:

  • Xi1<XiX_{i-1}<X_i, if SiS_i is <;
  • Xi1>XiX_{i-1}>X_i, if SiS_i is >.

Given a good non-negative integer sequence AA, divide it into as many good non-negative integer sequences as possible. That is, find a positive integer kk and kk good non-negative integer sequences B1,B2,ldots,BkB_1,B_2,\\ldots, B_k satisfying the following with the maximum possible value of kk:

  • For every 0leqileqN0 \\leq i \\leq N, the sum of the ii-th elements of B1,ldots,BkB_1,\\ldots,B_k equals AiA_i.

Constraints

  • 1leqNleq1001 \\leq N \\leq 100
  • 0leqAileq1040 \\leq A_i \\leq 10^4
  • SS is a string of length NN consisting of < and >.
  • AA is a good non-negative integer sequence. Particularly, AA has N+1N+1 elements.

Input

Input is given from Standard Input in the following format:

NN SS A0A_0 A1A_1 cdots\\cdots ANA_N

Output

Print your answer to Standard Output in the following format:

kk B1,0B_{1,0} B1,1B_{1,1} cdots\\cdots B1,NB_{1,N} :: Bk,0B_{k,0} Bk,1B_{k,1} cdots\\cdots Bk,NB_{k,N}

Here, Bi,jB_{i,j} denotes the value of the jj-th element of the good non-negative integer sequence BiB_i.


Sample Input 1

3
<><
3 8 6 10

Sample Output 1

2
1 5 4 7
2 3 2 3