Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func configure(scanner *bufio.Scanner) {
	// scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	for s := getNextString(scanner); s != "END OF INPUT"; s = getNextString(scanner) {
		ss := strings.Split(s, " ")
		for i := 0; i < len(ss); i++ {
			fmt.Fprint(writer, len(ss[i]))
		}
		fmt.Fprintln(writer, "")
	}
}

C++: #include <iostream>
#include <string>
using namespace std;

int main(){
	int n;
	string s;
	while( getline( cin , s ) , s != "END OF INPUT" ){
		n = 0;
		for(int i=0 ; i < (int)s.size() ; i++ ){
			if( i == (int)s.size()-1 ){
				cout << (n+1) << endl;
			}else if( s[i] == ' ' ){
				cout << n;
				n = 0;
			}else{
				n++;
			}
		}
	}
}

C++: #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    string s;
    while(true){
        getline(cin,s);
        if(s == "END OF INPUT") break;
        string div;
        s+=' ';
        rep(i,s.size()){
            if(s[i] == ' '){
                cout << div.size();
                div = "";
            }else{
                div+=s[i];
            }
        }
        cout << endl;
    }
}

C++: #include <iostream>

using namespace std;

int main(){
    string a;
    while (getline(cin,a)&&a!="END OF INPUT"){
        int num=0;
        for(int i=0;i<a.length();++i){
            if(a[i]==' ') {
                cout << num;
                num=0;
            }else num++;
        }
        cout << cnt << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    string s;
    while (getline(cin, s) && s != "END OF INPUT") {
        int count = 0;
        s += ' ';
        for (int i = 0; i < s.length(); i++) {
            if (s.at(i) != ' ') {
                count++;
            } else {
                cout << count;
                count = 0;
            }
            
            if (i == s.length()-1) {
                cout << endl;
            }
        }
    }
    
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    string str;
    while (getline(cin, str)) {
        if (str[str.size()-1] == '\n') str.resize(str.size()-1);
        if (str == "END OF INPUT") break;
        stringstream ss;
        ss << str;
        ss << '\n';
        string s;
        while (ss >> s) cout << s.size();
        cout << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <string>

using namespace std;

int main(void){
  string str;
  while(getline(cin,str)){
    if(str == "END OF INPUT") break;
    int l=0;
    for(int i=0;i<str.size();i++){
      if(str[i] == ' '){
	cout << l;
	l = 0;
      }else{
	l++;
      }
    }
    if(l)cout << l;
    cout << endl;
  }
}

C++: #include <iostream>
#include <string>

using namespace std;

int main(){
  string str;
  while(cin >> str){
    if(str == "END_OF_INPUT") break;
    str += " ";
    int idx = 0;
    while(idx < str.size()){
      int cnt = 0;
      while(str[idx++]!=" ") cnt++;
      cout << cnt;
    }
    cout << endl;
  }
}

C++: #include<iostream>
#include<string>
#include<queue>
using namespace std;

int main() {
	string s;
	while (getline(cin,s)) {
		if (s == "END OF INPUT")break;
		else {
			int sa=0;
			queue<int>q;
			for (int i = 0;i < s.size();i++) {
				if (s[i] != ' ')sa++;
				else {
					q.push(sa);
					sa = 0;
				}
			}
			q.push(sa);

			int b = q.size();

			for (int i = 0;i < b;i++) {
				cout << q.front();
				q.pop();
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
using namespace std;
string str;
int main() {
    while (getline(cin,str)) {
        if (str == "END OF INPUT") break;
        str += " ";
        int res = 0;
        for (int i = 0; i < str.size(); ++i) {
            if (str[i] == ' ') cout << res, res = 0;
            else ++res;
        }
        cout << endl;
    }
}

C++: #include <iostream>
#include <string>

using namespace std;

int main()
{
	string str;
	
	while(1){
		getline(cin, str);
		if(str == "END OF INPUT"){
			break;
		}
		int l = str.size();
		int c;
		for(int i = 0; i < l; i++){
			c = 1;
			i++;
			for(; i < l; i++){
				if(str[i] != ' '){
					c++;
				} else {
					cout << c;
					while(str[++i] == ' '){
						cout << 0;
					}
					break;
				}
			}
			i--;
		}
		cout << c << endl;
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>

#define reps(v, f, l) for (int v = (f), v##_ = (l); v < v##_; ++v)
#define rep(v, n) reps(v, 0, n)
#define lep(v, n) reps(v, 1, n + 1)

using namespace std;

typedef long long int lint;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }
template<typename T> void show(T& a, char del='\n', char last='\n'){ rep(i, a.size() - 1) cout << a[i] << del; cout << a[a.size() - 1] << last; }

vector<string> split(const string& S)
{
  istringstream stream(S);
  string field;
  vector<string> result;
  while (getline(stream, field, ' ')){
    result.push_back(field);
  }
  return result;
}

int main()
{
  string str;
  while (getline(cin, str), str != "END OF INPUT"){
    vector<string> ss = split(str);
    rep(i, ss.size()){
      printf("%d", ss[i].size());
    }
    puts("");
  }

  return 0;
}

C++: #include <iostream>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

int main() {
	char s[1000];
	while(true) {
		fgets(s, 1000, stdin);

		if(s[strlen(s)-1] == '\n') {
			s[strlen(s)-1] = '\0';
		}
		if(s[strlen(s)-1] == '\r') {
			s[strlen(s)-1] = '\0';
		}
		if (strcmp(s, "END OF INPUT") == 0) {
			break;
		}
		int len = 0;
		for (int i = 0; i < (int)strlen(s); i++) {
			if(s[i] != ' ') {
				len++;
			}
			else{
				cout << len;
				len = 0;
			}
		}
		cout << len-1 << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int main(){

	string a;
	
	while(getline(cin,a)){
		if(a=="END OF INPUT")
			break;
		else{
		int k=0;
		for(int i=0;i<a.size();i++){
			if(a[i]==' '){
				cout<<k;
				k=0;
			}
			else
				k++;
			
				
		}
		cout<<k<<endl;
		}
	}
	
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

int main()
{
    string s;
    while(getline(cin, s))
    {
        if(s == "END OF INPUT") break;
        int cnt = 0, l = s.size();
        REP(l)
        {
            if(s[i] == ' ') { cout << cnt; cnt = 0;}
            else cnt++;
        }
        cout << cnt << endl;


    }
    return 0;
}