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<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

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

C++: #include <stdio.h>
#include <string.h>

char s[100000];
int len;

int main() {
	while (fgets(s, 100000, stdin)) {
		s[strlen(s) - 1] = '\0';
		if (strcmp(s, "END OF INPUT") == 0) { break; }
		len = strlen(s);
		
		int word_len = 0;
		for (int i = 0; i < len; i++) {
			if (s[i] == ' ') { printf("%d", word_len); word_len = -1; }
			word_len++;
		}
		printf("%d\n", word_len);
	}
	return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	string str;
	while(getline(cin, str)){
		if(str=="END OF INPUT")break;
		stringstream ss;
		ss <<str;

		while(ss>>str){
			int x =str.length();
			cout <<x;
		}
		cout<<endl;
	}
	return 0;
}

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

int main() {
  string s;
  while(getline(cin, s) && s!="END OF INPUT") {
    int p = s.find(" ");
    while(p!=-1) {
      cout << p;
      s = s.substr(p+1);
      p = s.find(" ");
    }
    cout << endl;
  }
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

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

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

using namespace std;

int main()
{
    string S;
    
    while(true)
    {
        S = "";
        
        while(S == "")
        {
            getline(cin, S);
        }
        
        if(S == "END OF INPUT") { break; }
        
        int count_ = 0;
        
        for(int i = 0; i < S.size(); i++)
        {
            if(S[i] == ' ')
            {
                cout << count_;
                
                count_ = 0;
            }
            else
            {
                count_++;
            }
        }
        
        cout << count_ << 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") return 0;
		string res;
		int len = str.size(), word = 0;
		
		for (int i = 0; i < len; i++){
			if (str[i] != ' '){
				word++;
			}
			else {
				res += word + '0';
				word = 0;
			}
		}
		if (str[len - 1] != ' ') res += word + '0';
		
		cout << res << endl;
	}
	
	return (0);
}

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

int main(void){
	string str;
	while(std::getline(cin,str),str!="END OF INPUT"){
		std::vector<int> v;
		int c=0;
		for(int i=0;i<str.length();i++){
			if(str[i]==' '){
				v.push_back(c);
				c=0;
			}else{
				c++;
			}
		}
		if(c!=0)v.push_back(c);
		for(vector<int>::iterator it=v.begin();it!=v.end();it++){
			cout<<*it;
		}
		cout<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

const string eof = "END OF INPUT";
typedef vector <string> VS;
typedef vector <int> VI;
typedef istringstream ISS;

int main() {
    string line;
    while ( getline( cin, line ) ) {
        if ( line == eof ) break;
        string s = line;
        int n = s.size();
        n --;
        int cnt = 0;
        VI L;
        for ( int i = 0; i < n; ++ i ) {
            if ( s[i] == ' ' ) {
                if ( i > 0 && s[i-1] == ' ' ) {
                    L.push_back( 0 );
                } else if ( cnt > 0 ) {
                    L.push_back( cnt );
                }
                cnt = 0;
            } else {
                cnt ++;
            }
        }
        if ( cnt > 0 ) L.push_back( cnt );
        for ( VI::iterator it_i = L.begin(); it_i != L.end(); ++ it_i ) {
            cout << *it_i;
        }
        cout << endl;
    }
	return 0;
}

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

using namespace std;

int main(){

	string in;

	while(getline(cin,in)){
		if(in == "END OF INPUT") break;
		in+=" ";
		int sum = 0;
		for(int i = 0; i < in.length(); i++){
			if(in[i] == ' '){
				cout << i-sum;
				sum = i+1;
			}
		}
		cout << endl;
	}

	return 0;
}