S = input()
t = 0
H = [0]
for c in S:
    if c == '\\':
        t -= 1
        H.append(t)
    elif c == '_':
        H.append(t)
    elif c == '/':
        t += 1
        H.append(t)
L = [0 for _ in range(len(H))] 
for i in range(1, len(H)):
    L[i] = max(L[i-1], H[i])
R = [H[len(H)-1]]
for i in reversed(range(len(H)-1)):
    R.append(max(R[len(R)-1], H[i]))
R.reverse()
C = [min(L[i], R[i]) for i in range(len(H))]
D = 0
ans = []
for i in range(len(H)-1):
    D += (C[i] - H[i]) + (C[i+1] - H[i+1])
    if C[i+1] == H[i+1] and D != 0:
        ans.append(D // 2)
        D = 0
print(sum(ans))
ans.insert(0, len(ans))
print(' '.join(map(str, ans))) S = input() S input() input t = 0 t 0 H = [0] H [0] 0 for c in S:
    if c == '\\':
        t -= 1
        H.append(t)
    elif c == '_':
        H.append(t)
    elif c == '/':
        t += 1
        H.append(t) c S if c == '\\':
        t -= 1
        H.append(t)
    elif c == '_':
        H.append(t)
    elif c == '/':
        t += 1
        H.append(t) c == '\\' c '\\' t -= 1 t 1 H.append(t) H.append H append t elif c == '_':
        H.append(t)
     c == '_' c '_' H.append(t) H.append H append t elif c == '/':
        t += 1
        H.append(t) c == '/' c '/' t += 1 t 1 H.append(t) H.append H append t 0 for _ in range(len(H)) for _ in range(len(H)) _ range(len(H)) range len(H) len H for _ in range(len(H)) 0 L = [0 for _ in range(len(H))] L [0 for _ in range(len(H))] for i in range(1, len(H)):
    L[i] = max(L[i-1], H[i]) i range(1, len(H)) range 1 len(H) len H L[i] = max(L[i-1], H[i]) L[i] L i max(L[i-1], H[i]) max L[i-1] L i-1 i 1 H[i] H i R = [H[len(H)-1]] R [H[len(H)-1]] H[len(H)-1] H len(H)-1 len(H) len H 1 for i in reversed(range(len(H)-1)):
    R.append(max(R[len(R)-1], H[i])) i reversed(range(len(H)-1)) reversed range(len(H)-1) range len(H)-1 len(H) len H 1 R.append(max(R[len(R)-1], H[i])) R.append R append max(R[len(R)-1], H[i]) max R[len(R)-1] R len(R)-1 len(R) len R 1 H[i] H i R.reverse() R.reverse R reverse min(L[i], R[i]) for i in range(len(H)) for i in range(len(H)) i range(len(H)) range len(H) len H for i in range(len(H)) min(L[i], R[i]) min L[i] L i R[i] R i C = [min(L[i], R[i]) for i in range(len(H))] C [min(L[i], R[i]) for i in range(len(H))] D = 0 D 0 ans = [] ans [] for i in range(len(H)-1):
    D += (C[i] - H[i]) + (C[i+1] - H[i+1])
    if C[i+1] == H[i+1] and D != 0:
        ans.append(D // 2)
        D = 0 i range(len(H)-1) range len(H)-1 len(H) len H 1 D += (C[i] - H[i]) + (C[i+1] - H[i+1]) D (C[i] - H[i]) + (C[i+1] - H[i+1]) C[i] - H[i] C[i] C i H[i] H i C[i+1] - H[i+1] C[i+1] C i+1 i 1 H[i+1] H i+1 i 1 if C[i+1] == H[i+1] and D != 0:
        ans.append(D // 2)
        D = 0 C[i+1] == H[i+1] and D != 0 C[i+1] == H[i+1] C[i+1] C i+1 i 1 H[i+1] H i+1 i 1 D != 0 D 0 ans.append(D // 2) ans.append ans append D // 2 D 2 D = 0 D 0 print(sum(ans)) print sum(ans) sum ans ans.insert(0, len(ans)) ans.insert ans insert 0 len(ans) len ans print(' '.join(map(str, ans))) print ' '.join(map(str, ans)) ' '.join ' ' join map(str, ans) map str ans R = [H[len(H)-1]] [H[len(H)-1]] R L = [0 for _ in range(len(H))] [0 for _ in range(len(H))] L ans = [] [] ans S = input() input() S C = [min(L[i], R[i]) for i in range(len(H))] [min(L[i], R[i]) for i in range(len(H))] C t -= 1 1 t H = [0] [0] H t = 0 0 t t += 1 1 t D += (C[i] - H[i]) + (C[i+1] - H[i+1]) (C[i] - H[i]) + (C[i+1] - H[i+1]) D D = 0 0 D D = 0 0 D
S = input()
t = 0
H = [0]
for c in S:
    if c == '\\':
        t -= 1
        H.append(t)
    elif c == '_':
        H.append(t)
    elif c == '/':
        t += 1
        H.append(t)
L = [0 for _ in range(len(H))] 
for i in range(1, len(H)):
    L[i] = max(L[i-1], H[i])
R = [H[len(H)-1]]
for i in reversed(range(len(H)-1)):
    R.append(max(R[len(R)-1], H[i]))
R.reverse()
C = [min(L[i], R[i]) for i in range(len(H))]
D = 0
ans = []
for i in range(len(H)-1):
    D += (C[i] - H[i]) + (C[i+1] - H[i+1])
    if C[i+1] == H[i+1] and D != 0:
        ans.append(D // 2)
        D = 0
print(sum(ans))
ans.insert(0, len(ans))
print(' '.join(map(str, ans)))
