Problem:


Problem P02: Yes, I have a number

博士：　ペーター君「Yes, I have a number」って知ってるかい？

ぺーター：　このまえテレビでやってましたよ。文章に含まれる各単語の文字数で何かを覚えるというものですよね。
「Yes, I have a number」 だから、「3.14という数字」という意味になって円周率を覚えるためのキーワードになっているんですよね。

博士：　ペーター君、それは違うんじゃ。
これは、3.1416 と解釈せねばならぬのじゃ。円周率は3.14159...だからのう。

ペーター：　それじゃ、あの番組は日本が円周率を3.14と教えているからといって無理矢理省略したんですか！？

博士：　、、、。小学校で教える円周率がやっと3から3.14に戻っただけでもよしとしよう。

ペーター：　そもそも、これで本当に覚えられるんですか？

博士：　日本人には難しいかもしれん。英語圏の人たちは使うようじゃよ、英語でゴロ合わせをするのは難しいからのぉ。

ペーター：　それにしても、チェックするのが面倒くさそうですね。

博士：　そこでじゃ、文章を単語の文字数の数列に変換するプログラムを作ってほしいのじゃ。

ペーター：　了解しました。詳しい仕様を教えてください博士。

博士：　1行の文章を入力としよう。簡単のためにアルファベットと空白のみを含む文章でよいぞ。
この文章について、空白・文頭・文末に挟まれた文字列の長さを順番に出力してくれ。
文字列の文字数は9を超えないと過程してよいぞ。

例えば、"Yes I have" の Yes は文頭と最初の空白で区切られているから文字数は 3 、 I は 1 つ目と 2 つ目の空白に区切られていて文字数は 1 じゃ。

博士：　・・・そうじゃ、空白が連続した場合の、文字数が 0 になる文字列も忘れずにな。

Input

複数のデータセットが入力として与えられます。各データセットで、アルファベットと空白を含む文字列が１行に与えられます。

文字列が "END OF INPUT" のとき、入力の終わりとします。この入力に対する出力を行ってはいけません。

Output

各データセットについて、文字列に対する文字数の数列を１行に出力して下さい。

Sample Input

Yes I have a number
How I wish I could calculate an unused color for space
Thank you
END OF INPUT

Output for the Sample Input

31416
31415926535
53



Sample input:
Yes I have a number
How I wish I could calculate an unused color for space
Thank you
END OF INPUT


Sample output:
31416
31415926535
53

Submission status: Wrong Answer

Solution code:
while True:
    s = input()
    if s == 'END OF INPUT': break
    if '  ' in s: s.replace('  ', ' 0 ')
    s = s.split()
    for i in s: print(len(i) if i != '0' else 0, end='')
    print('')

Submission status: Wrong Answer

Solution code:
while True:
    s = input()
    if s == 'END OF INPUT': break
    if '  ' in s: s = s.replace('  ', ' 0 ')
    s = s.split()
    for i in s: print(len(i) if i != '0' else 0, end='')
    print('')

Submission status: Wrong Answer

Solution code:
while 1:
 s=raw_input()
 if"END OF INPUT"==s:break
 print"".join(map(str,map(len,s.split())))

Submission status: Wrong Answer

Solution code:
while True:
    dataset = input().split()
    if dataset == ["END", "OF", "INPUT"]: break
    print(''.join(map(str, [len(d) for d in dataset])))

Submission status: Wrong Answer

Solution code:
while True:
    dataset = input().split(' ')
    if dataset == ["END", "OF", "INPUT"]: break
    i = tmp = 0
    ans = ''
    while i < len(dataset):
        if dataset[i] == '':
            tmp += 1
        else:
            if tmp:
                ans += str(tmp)
                tmp = 0
                ans += str(len(dataset[i]))
            else:
                ans += str(len(dataset[i]))
        i += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
while True:
    dataset = input().split(' ')
    if dataset == ["END", "OF", "INPUT"]: break
    if dataset[0]=='': dataset = dataset[1:]
    i = tmp = 0
    ans = ''
    while i < len(dataset):
        if dataset[i] == '':
            tmp += 1
        else:
            if tmp:
                ans += str(tmp)
                tmp = 0
                ans += str(len(dataset[i]))
            else:
                ans += str(len(dataset[i]))
        i += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
while True:
    number = input().split(' ')
    if number == ['END', 'OF', 'INPUT']: break
    b = False
    ans = []
    for num in number:
        if num == '':
            b = True
            continue
        if b:
            ans += ['0'] + [str(len(num))]
            b = False
        else:
            ans += [str(len(num))]
    print(''.join(ans))

Submission status: Wrong Answer

Solution code:
while True:
    i = input()
    if i == "END OF INPUT":
        break
    print("".join(map(str, [len(x) for x in i.split()])))

Submission status: Wrong Answer

Solution code:
while True:
    s = input().split()
    if s == ["END","OF","INPUT"]:break
    print("".join(list(map(str,map(len, s)))))

Submission status: Wrong Answer

Solution code:
while True:
    s=raw_input()
    if s=="END OF INPUT":break
    print "".join(str(len(w)) for w in s.split())

Submission status: Wrong Answer

Solution code:
while 1:
	a=map(str,raw_input().split())
	if a[0]=="END":break
	print "".join(map(str,[len(a[i]) for i in range(len(a))]))

Submission status: Wrong Answer

Solution code:
while 1:
	a=map(str,raw_input().split())
	if a==["END","OF","INPUT"]:break
	print "".join(map(str,[len(a[i]) for i in range(len(a))]))

Submission status: Wrong Answer

Solution code:
while 1:
	a=map(str,raw_input().replace("  "," Z ").split())
	if a[0]=="END":break
	print "".join(map(str,[len(a[i]) if a[i]!="Z" else 0 for i in range(len(a))]))

Submission status: Wrong Answer

Solution code:
while 1:
	a=map(str,raw_input().replace("  "," . ").split())
	if a[0]=="END":break
	print "".join(map(str,[len(a[i]) if a[i]!="." else 0 for i in range(len(a))]))

Submission status: Wrong Answer

Solution code:
while 1:
    m=raw_input()
    if m[1]=="N":break
    print "".join(str(len(w)) for w in m.split(" "))

Submission status: Wrong Answer

Solution code:
while 1:
    m=raw_input()
    if m[:3]=="END":break
    print "".join(str(len(w)) for w in m.split(" "))

Submission status: Wrong Answer

Solution code:
while 1:
    m=raw_input()
    if m[-1]=="T":break
    print "".join(str(len(w)) for w in m.split(" "))

Submission status: Accepted

Solution code:
# AOJ 1042: Yes, I have a number
# Python3 2018.7.6 bal4u

while True:
	s = input()
	if s == "END OF INPUT": break
	ans, i, ls = '', 0, len(s)
	while i < ls:
		w = 0
		while i < ls and s[i] == ' ':
			w, i = w+1, i+1
		if w > 1: ans += '0'*(w-1)
		w = 0
		while i < ls and s[i].isalpha():
			w, i = w+1, i+1
		if w > 0: ans += chr(ord('0')+w)
	print(ans)

Submission status: Accepted

Solution code:
# AOJ 1042: Yes, I have a number
# Python3 2018.7.6 bal4u

while True:
	s = input()
	if s == "END OF INPUT": break
	ans, i, ls = '', 0, len(s)
	while i < ls:
		w = 0
		while i < ls and s[i] == ' ':
			w, i = w+1, i+1
		if w > 1: ans += '0'*(w-1)
		w = 0
		while i < ls and s[i].isalpha():
			w, i = w+1, i+1
		if w > 0: ans += str(w)
	print(ans)

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == 'END OF INPUT': break
    while True:
        if '  ' in s: s = s.replace('  ', ' 0 ')
        else: break
    s = s.split()
    for i in s: print(len(i) if i != '0' else 0, end='')
    print('')

Submission status: Accepted

Solution code:
while 1:
 s=raw_input()
 if"END OF INPUT"==s:break
 print"".join(map(str,map(len,s.split(" "))))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu Jun  2 13:42:22 2016

"""

while True:
    S = input()
    if S == "END OF INPUT":
        break
    n = 0
    for l in S:
        if l == " ":
            print(n, end="")
            n = 0
        else:
            n += 1
            
    print(n)

Submission status: Accepted

Solution code:
while 1:
    n=input()
    if n=="END OF INPUT":break
    c=0
    for i in n:
        if i==' ': 
            print(c,end="")
            c=0
        else:c+=1
    print(c)

Submission status: Accepted

Solution code:
while True:
    number = input().split(' ')
    if number == ['END', 'OF', 'INPUT']: break
    ans = []
    for num in number:
        ans = ans + ['0'] if num == '' else ans + [str(len(num))]
    print(''.join(ans))

Submission status: Accepted

Solution code:
while True:
    a = input()
    if a == "END OF INPUT": break
    ans=[]
    cnt=0
    for i in range(len(a)):
        if a[i]== ' ':
            ans.append(cnt)
            cnt=0
        else: 
            cnt+=1
    ans.append(cnt)
    for x in ans:
        print(x, end='')
    print()

Submission status: Accepted

Solution code:
while 1:
    st = input()
    if st == "END OF INPUT":
        break
    n = 0
    for i in st:
        if i == " ":
            print(n, end="")
            n = 0
        else:
            n += 1
    print(n)

Submission status: Accepted

Solution code:
while True:
    i = input()
    if i == "END OF INPUT":
        break
    print("".join(map(str, [0 if x == '' else len(x) for x in i.split(' ')])))

Submission status: Accepted

Solution code:
while True:
    i = input()
    if i == "END OF INPUT":
        break
    print(*[0 if x == '' else len(x) for x in i.split(' ')], sep='')

Submission status: Accepted

Solution code:
while True:
    i = input()
    if i == "END OF INPUT":
        break
    print(*[(x != '') * len(x) for x in i.split(' ')], sep='')

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == "END OF INPUT":break
    t = ""
    while True:
        if s[0] == " ":
            while s[0] == " ":
                t += "0"
                s = s[1:]
        else:
            try:
                i = s.index(" ")
                t += str(i)
                s = s[i + 1:]
            except:
                t += str(len(s))
                break
    print(t)

Submission status: Accepted

Solution code:
while True:
    s=raw_input()
    if s=="END OF INPUT":break
    print "".join(str(len(w)) for w in s.split(" "))

Submission status: Accepted

Solution code:
while 1:
    m=raw_input()
    if m=="END OF INPUT":break
    print "".join(str(len(w)) for w in m.split(" "))

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == "END OF INPUT":
        break
    list=[]
    d = 0
    count = 0
    while d < len(s):
        if s[d] == " ":
            list.append(count)
            count = 0
        else:
            count += 1
        d += 1
    list.append(count)
    print(*list,sep="")

Submission status: Accepted

Solution code:
while True:
    word = (input())
    if word == 'END OF INPUT': break
    ans = 0
    for i in word: 
        if ' ' == i:
            print(ans,end='')
            ans = 0
        else: ans += 1
    print(ans)

Submission status: Accepted

Solution code:
while True:
    a=input()
    if a=='END OF INPUT':
        break
    b=list(a)
    c=0
    for i in range(len(b)):
        if b[i]!=' ':
            c+=1
        else:
            print(c,end='')
            c=0
    print(c)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
while True:
    n=input()
    if n=="END OF INPUT":
        break
    
    a=list(n)
    count=0
    for i in range(len(a)):
        if a[i]!=' ':
            count+=1
        else:
            print(count,end="")
            count=0
    print(count)

Submission status: Accepted

Solution code:
while True:
    m = str(input());
    if m == "END OF INPUT":
        break;
    l = [i.strip() for i in m.split(' ')]
    for j in range(0,len(l)):
        print(len(l[j]),end = "");
    print();

Submission status: Accepted

Solution code:
while True:
    a = input()
    if a == "END OF INPUT":
        break
    a = a.split(' ')
    for i in range(len(a)):
        print(len(a[i]),end='')
    print()

Submission status: Accepted

Solution code:
while True:
    n = input()
    if n == "END OF INPUT":
        break
    ans = 0
    for i in n:
        if i == " ":
            print(ans, end="")
            ans = 0
        else:
            ans += 1
    print(ans)

Submission status: Accepted

Solution code:
while True:
    a=input()
    if a=="END OF INPUT":
        break
    b=0
    for i in a:
        if i==" ":
            print(b,end='')
            b=0
        else:
            b+=1
    print(b)

Submission status: Accepted

Solution code:
while True:
    n=input()
    if n=='END OF INPUT':
        break
    c=0
    for i in n :
        if i==' ':
            print(c,end='')
            c=0
        else:
            c+=1
    print(c)

Submission status: Accepted

Solution code:
while True:
    ans = []
    n = input()
    if n == "END OF INPUT":
        break
    else:
        a = n.split(' ')
        for i in range(len(a)):
            ans.append(len(a[i]))
        print(*ans,sep="")

Submission status: Accepted

Solution code:
while True:
    s=str(input())
    if s=="END OF INPUT":
        break
    a,b=[],0
    for i in range(len(s)):
        if s[i]==" ":
            a.append(b)
            b=0
        else:
            b+=1
    a.append(b)
    print(*a,sep='')

Submission status: Accepted

Solution code:
while True:
  s = input()
  if s == "END OF INPUT":
    break
  l = 0
  for i in s:
    if i == ' ':
      print(l,end='')
      l = 0
    else:
      l += 1
  print(l)

Submission status: Accepted

Solution code:
while 1:
    put=input()
    if(put=="END OF INPUT"):
        break
    print(''.join(map(str,map(len,put.split(' ')))))

Submission status: Accepted

Solution code:
while True:
    ans = []
    n = input()
    if n == "END OF INPUT":
        break
    else:
        a = n.split(' ')
        for i in range(len(a)):
            ans.append(len(a[i]))
        print(*ans, sep="")

Submission status: Accepted

Solution code:
while True:
    a=input()
    if a==('END OF INPUT') : break
    
    s = list(a.split(' '))
    for i in range(len(s)):
        print(len(s[i]), end='')
    print()

Submission status: Accepted

Solution code:
while True:
    ans=[]
    n=input()
    if n=="END OF INPUT":
        break
    else:
        a=n.split(' ')
        for i in range(len(a)):
            ans.append(len(a[i]))
        print(*ans,sep="")

Submission status: Accepted

Solution code:
while True:
    ans = []
    n = input()
    if n == "END OF INPUT":
        break
        
    else:
        a = n.split(' ')
        #print(a)
        
        for i in range(len(a)):
            ans.append(len(a[i]))
            
        print(*ans, sep="")

Submission status: Accepted

Solution code:
while True:
    l=[]
  
    w=input()
    if w=="END OF INPUT":
        break
   
    list=w.split(' ')
    
    for i in range(len(list)):
        l.append(len(list[i]))
    l=[str(a) for a in l]
    l=''.join(l)
    print(*l,sep='')

Submission status: Accepted

Solution code:
while True:
    s=list(map(str,input().split(' ')))
    if s==['END','OF','INPUT']:
        break
    for i in range(len(s)):
        w=list(s[i])
        print(len(w),end='')
    print()

Submission status: Accepted

Solution code:
while True:
    x=input()
    if x=="END OF INPUT":
        break
    else:
        x=x.replace(" ","-")
        X=x.split("-")
        for i in X:
            if i=="--":
                print(0)
            else:
                print(len(i),end="")
        print()

Submission status: Accepted

Solution code:
# 88
while True:
    a = input().split(" ")
    if a == ['END', 'OF', 'INPUT']:
        break

    for i in range(len(a) - 1):
        print(len(a[i]), end="")
    print(len(a[len(a) - 1]))

Submission status: Accepted

Solution code:
import re
while 1: 
    n=input()
    if n=='END OF INPUT':
        break
    s=re.split('[ ]', n)
    a=len(s)
    for i in range(a):
         print(len(s[i]),end ='')
    print("")

Submission status: Accepted

Solution code:
while 1:
    s = input()
    if s == 'END OF INPUT':
        break
    a = list(s.split(' '))
    for i in range(len(a)):
        print(len(a[i]), end='')
    print()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
while True:
    n=input()
    if n=='END OF INPUT':
        break
    X=list(n)
    c=0
    for i in range(len(X)):
        if X[i]==' ':
            print(c,end='')
            c=0
        else:
            c+=1
    print(c)

Submission status: Accepted

Solution code:
while True:
    x=input()
    if x=="END OF INPUT":
        break
    else:
        x=x.replace(" ","-")
        y=x.split("-")
        for i in y:
            if i=="--":
                print(0)
            else:
                print(len(i),end="")
        print()

Submission status: Accepted

Solution code:
while True:
    n = input()
    ans = []
    if n == "END OF INPUT":
        break
    l = n.split(' ')
    for i in range(len(l)):
        ans.append(len(l[i]))
    ans= [str(i) for i in ans]
    print(''.join(ans))

Submission status: Accepted

Solution code:
while True:
    x=input()
    if x=='END OF INPUT':
        break
    lst=x.split(' ')
    a=[]
    for i in range(len(lst)):
        a.append(len(lst[i]))
    print(*a,sep='')

Submission status: Accepted

Solution code:
while True:
   x = input()
   if x=='END OF INPUT':
      break
   x = x.split(' ')
   for i in range(len(x)):
      print(len(x[i]), end='')
   print()

Submission status: Accepted

Solution code:
while True:
    n=input()
    if n=='END OF INPUT':
        break
    s=0
    for i in n:
        if i==' ':
            print(s,end='')
            s=0
        else:
            s+=1
    print(s)

Submission status: Accepted

Solution code:

while True:
    tmp = input()
    if tmp=="END OF INPUT": break
    tmp = tmp.split(" ")
    
    ans = []
    for i in tmp:
        ans.append(len(i))
    print(*ans,sep="")

Submission status: Accepted

Solution code:
# coding: utf-8
#88
import re

while True:
    b = input()
    
    if b=="END OF INPUT":
        break
    
    B = re.split('[ ]',b)
    #print(B)
    
    for i in range (len(B)-1):
        print(len(B[i]),end='')
    print(len(B[-1]))

Submission status: Accepted

Solution code:
while True:
   s = input()
   if s == "END OF INPUT": break
   
   s += " " 
   #print(s)
   
   c = 0
   for i in range(len(s)):
      #print(s[i])
      if s[i] == ' ':
         print(c, end = "")
         c = 0
         continue
      c += 1
   print("")

Submission status: Accepted

Solution code:
while True:
    s=input()
    if s=="END OF INPUT":
        break
    i=0
    ans=0
    while i<len(s):
        if s[i]==" ":
            print(ans,end="")
            ans=0
            i+=1
        else :
            ans+=1
            i+=1
    print(ans)

Submission status: Accepted

Solution code:
while True:
    a=input()
    if a=='END OF INPUT':
        break
    moji=0
    for i in a:
        if i==' ':
            print(moji,end='')
            moji=0
        else:
            moji+=1
    print(moji)

Submission status: Accepted

Solution code:
L=[]
while True:
    a=str(input())
    
    if a=="END OF INPUT":
        break
    
    a=a.split(" ")
    L.append(a)
    b=len(a)
    c=L[0]
    
    for i in range(b):
        d=c[i]
        print(len(d),end="")
    L=[]

    print()

Submission status: Accepted

Solution code:
import re

while True:
    d = input()
    if d == 'END OF INPUT':
        break
    lst = re.split('[ ]',d)
    p = []
    for i in range(len(lst)):
        p.append(len(lst[i]))
    
    for i in range(len(lst)):
        if lst[i] == ' ':
            p[i] = 0
    P = [str(j) for j in p]
    P = ''.join(P)
    print(P)

Submission status: Accepted

Solution code:
while True:
    x=input()
    if x=="END OF INPUT" : break
    ans=0
    for i in x:
        if i!=' ':
            ans+=1
        else:
            print(ans,end="")
            ans=0
    print(ans)

Submission status: Accepted

Solution code:
while True:
    a=input()
    if a=="END OF INPUT":
        break
    A=list(a)
    c=0
    for i in range(len(A)):
        if A[i]==' ':
            print(c,end="")
            c=0
        else:
            c+=1
    print(c)

Submission status: Accepted

Solution code:
import re
while True:
    a = input()
    if a == 'END OF INPUT':
        break
    b = list(re.split(' ',a))
    c = len(b)
    for i in range(c):
        e = len(b[i])
        print(e,end='')
    print()

Submission status: Accepted

Solution code:
while True:
    x=input()
    if x=="END OF INPUT":
        break
    else:
        l=x.split(" ")
        y=[]
        for i in range(len(l)):
            y.append(len(l[i]))
            print(y[i],end="")
        print("")

Submission status: Accepted

Solution code:
while True:
    a = input()
    b = list(a)
    if a == "END OF INPUT":
        break
    count = 0
    for i in range(len(b)):
        if b[i] == ' ':
            print(count,end="")
            count = 0
        else:
            count += 1
    print(count)

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == 'END OF INPUT':
        break
    c = 0
    for i in range(len(s)):
        if s[i:i + 1] == ' ':
            print(c, end='')
            c = 0
        else:
            c += 1
    
    print(c)

Submission status: Accepted

Solution code:
while True:
    st = input()
    if st == "END OF INPUT":
        break
    print("".join(map(lambda x: str(len(x)), st.split(" "))))

Submission status: Accepted

Solution code:
#1042
import re
while True:
    l = []
    x = str(input())
    if x =='END OF INPUT':
        break
    y = re.split('[ ]',x)
    for i in range(len(y)):
        l.append(len(y[i]))
    for j in range(len(l)-1):
        print(l[j],end='')
    print(l[-1])

Submission status: Accepted

Solution code:
while True:
    s = str(input())
    
    if s == 'END OF INPUT':
        break
    
    S = []
    l = s.split(' ')
    S.extend(l)
    m = len(S)
    
    A = []
    for i in range(m):
        L = len(S[i])
        A.append(L)
    
    
    print(*A,sep='')

Submission status: Accepted

Solution code:
while True:
    s=input()
    if s=="END OF INPUT":
        break
    c=0
    for i in s:
        if i==' ': 
            print(c, end="")
            c=0
        else:
            c+=1
    print(c)

Submission status: Accepted

Solution code:
while True:
    n=input()
    if n=='END OF INPUT':
        break
    
    n=list(n)
    m=[]
    sum=0
    for i in range(len(n)):
        if n[i]==' ':
            m.append(sum)
            sum=0
        else:
            sum+=1
    print(*m,sum,sep='')

Submission status: Accepted

Solution code:
while True:
    x=input()
    if x=="END OF INPUT":
        break
    else:
        x=x.replace(" ","-")
        X=x.split("-")
        for i in X:
            if i=="--":
                print(0)
            else:
                print(len(i),end="")
        print()

Submission status: Accepted

Solution code:
while True:
    a=input()
    if a=="END OF INPUT":
        break
    A=list(a)
    c=0
    for i in range(len(A)):
        if A[i]==' ':
            print(c,end="")
            c=0
        else:
            c+=1
    print(c)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

while True:
   s = input()
   if s == "END OF INPUT": break
   
   s += " " #文字列の文末にスペースを加える
   #print(s)
   
   c = 0
   for i in range(len(s)):
      #print(s[i])
      if s[i] == ' ':
         print(c, end = "")
         c = 0
         continue
      c += 1
   print("")

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == 'END OF INPUT':
        break
    s = s.translate(str.maketrans({' ': ','}))
    s = s.split(',')
    ans = ''
    for i in s:
        ans += str(len(i))
    print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin

while True:
  s = stdin.readline().rstrip()
  if s == 'END OF INPUT':
    break
  ans = ''
  cnt = 0
  for i in s:
    if i == ' ':
      ans += str(cnt)
      cnt = 0
    else:
      cnt += 1
  ans += str(cnt)
  print(ans)

Submission status: Accepted

Solution code:
while 1:
    inp=input()
    if(inp=="END OF INPUT"):
        break
    print(''.join(map(str,map(len,inp.split(' ')))))

Submission status: Accepted

Solution code:
while True:
    retu=input()
    if retu=="END OF INPUT":
        break
    
    moji=retu.split(" ")
    
    n=len(moji)
    
    for i in range(n):
        k=len(moji[i])
        print(k, end="")
    
    print()

Submission status: Accepted

Solution code:
import re

while True:
    a = input()
    
    if a == "END OF INPUT":
        break
    
    a = re.split('[ ]',a)



    ans = []

    for i in a:
       ans.append(len(i))
   
    ans = [str(i) for i in ans]
    ans = "".join(ans)
    print(ans)

Submission status: Accepted

Solution code:
while True:
    s=input()
    if s=="END OF INPUT":
        break
    c=0
    for i in s:
        if i!=" ":
            c+=1
        else:
            print(c,end="")
            c=0
    print(c)

Submission status: Accepted

Solution code:
while True:
    text = input()
    
    if text=='END OF INPUT':
        break
    
    TEXT = text.split(' ')
    for i in range(len(TEXT)):
        print(len(TEXT[i]),end='')
    
    print('')

Submission status: Accepted

Solution code:
while True:
    text = input()
    if text == 'END OF INPUT':
        break
    text = list(text.split(' '))
    answer = []
    for i in range(len(text)):
        answer.append(str(len(text[i])))
    print("".join(answer))

Submission status: Accepted

Solution code:
while True :
    a = input()
    if a == "END OF INPUT" :
        break
    
    b = list(a)
    count = 0
    for i in range(len(b)) :
        if b[i] != ' ' :
            count += 1
        else :
            print(count, end="")
            count = 0
    print(count)

Submission status: Accepted

Solution code:
while True :
    S = input()
    
    if S == "END OF INPUT" :
        break
    
    else :
        S += " "
        N = []
        s = 0
        b = 0
        
        for i in range(len(S)) :
            if S[i] != " " :
                s += 1
            else :
                b += 1
                if b == 1 :
                    N.append(s)
                    s = 0
                    b = 0
                else :
                    N.append(0)
                    b = 0
  
        for i in range(len(N)) :
            if i == len(N) - 1 :
                print(N[i])
            else :
                print(N[i], sep = "", end = "")

Submission status: Accepted

Solution code:
while 1:
    a = input()
    if a == "END OF INPUT":
        break
    else:
        c = 0
        for i in a:
            if i == ' ':
                print(c,end = "")
                c = 0
            else:
                c += 1
        print(c)

Submission status: Accepted

Solution code:
while 1:
    n=input()
    if n=="END OF INPUT":
        break
    c=0
    for i in n:
        if i==' ': 
            print(c,end="")
            c=0
        else:c+=1
    print(c)

Submission status: Accepted

Solution code:
while True:
    s = input()
    if s == 'END OF INPUT':
        break
    
    # for word in s.split():
    #     print(len(word), end='')
    # print()
    
    count = 0
    for i in range(len(s)):
        if s[i:i + 1] == ' ':
            print(count, end='')
            count = 0
        else:
            count += 1
    
    print(count)

Submission status: Accepted

Solution code:
import sys
while True:
	s=sys.stdin.readline().rstrip()
	if s=="END OF INPUT":
		exit()
	s=s.split(" ")
	ans=""
	for i in range(len(s)):
		ans+=str(len(s[i]))
	print(ans)

Submission status: Accepted

Solution code:
while True:
    line = input()
    if line == 'END OF INPUT':
        break

    output_count_list = []
    count = 0
    for c in line:
        if c != ' ':
            count += 1
        else:
            output_count_list.append(str(count))
            count = 0
    output_count_list.append(str(count))
    print(''.join(output_count_list))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
def main():
    s = input()
    if s == "END OF INPUT":
        return False
    if s[0] == " ":
        s[0] = "."
    for _ in range(100):
        s = s.replace("  ", " . ")
    lst = s.split()
    ans = []
    for i in lst:
        if i == ".":
            ans += [0]
        else:
            ans += [len(i)]
    print("".join(map(str, ans)))
    return True

while main():
    pass

Submission status: Accepted

Solution code:
#import pysnooper
#import os,re,sys,operator,math,heapq,string
#from collections import Counter,deque
#from operator import itemgetter
#from itertools import accumulate,combinations,groupby,combinations_with_replacement
from sys import stdin,setrecursionlimit
#from copy import deepcopy

setrecursionlimit(10**6)
input=stdin.readline

while 1:
    s=input().rstrip()
    if s=="END OF INPUT":
        break
    ans=""
    now=0
    for i in range(len(s)):
        if s[i]==" ":
            ans+=str(now)
            now=0
        else:
            now+=1
    print(ans+str(now))

Submission status: Accepted

Solution code:
flag = True
while flag:
    n = input()
    if n == "END OF INPUT":
      flag = False
    else:
      count = 0
      for c in n:
          if c == " ":
            print(count, end = "")
            count = 0
          else:
            count += 1
      print(count)

Submission status: Accepted

Solution code:
# coding=utf-8

###
### for atcorder program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

def conv(s):
    num = 3
    if s == 'A':
        num = 0
    elif s == 'B':
        num = 1
    elif s == 'AB':
        num = 2
    return num

N = get_input()

for row in N[:-1]:
    PI = [x for x in row.split(' ')]
    for i in PI:
        print(len(i), end='')
    print()

Submission status: Accepted

Solution code:
while 1:
    word = input()
    if word == "END OF INPUT":
        break

    ans = ""
    cnt = 0
    for w in word:
        if w == " ":
            ans += str(cnt)
            cnt = 0
        else:
            cnt += 1

    ans += str(cnt)
    print(ans)

Submission status: Accepted

Solution code:
while True:
  s = input()
  if s == "END OF INPUT":
    break
  lst = []
  ind = 0
  count = 0
  while ind < len(s):
    if s[ind] == " ":
      lst.append(count)
      count = 0
    else:
      count += 1
    ind += 1
  lst.append(count)
  print(*lst,sep="")

Submission status: Accepted

Solution code:
while True:
    m = input()
    if m == "END OF INPUT":
        break
    m = m.split(" ")
    li = []
    for i in m:
        li.append(len(i))
    print("".join(map(str, li)))