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>
using namespace std;
string s;
long long int a;
int j,i;
int main(){
  for(;getline(cin,s),s!="END OF INPUT";){
    int m=int(s.size());
    for(j=a=i=0;i<m;i++){
      if(s[i]==' '){
	cout<<i-j;
	j=i+1;
      }
    }
    cout<<m-j<<endl;
  }
}

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


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

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

int main(){
    string s;
    while(getline(cin, s)){
        if(s == "END OF INPUT") break;
        int cnt = 0;
        bool in = true;
        for(int i = 0; i < s.length(); i++){
            if(s[i] != ' '){
                in = true;
                cnt++;
            }else{
                if(in){
                    cout << cnt;
                    cnt = 0;
                    in = false;
                }else{
                    in = true;
                }
            }
        }
        cout << cnt << endl;
    }   
    return 0; 
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdio>
#include <istream>
#include <sstream>
#include <iomanip>
#include <iterator>
#include <climits>
using namespace std;

typedef ostringstream OSS;
typedef istringstream ISS;

typedef vector<int> VI;
typedef vector< VI > VVI;

typedef long long LL;

typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define X first
#define Y second

// 1テヲツ鳴?・ツュツ耀plit ティツヲツ《stream
vector<string> split(const string &str, char delim) {
	istringstream iss(str); string tmp; vector<string> res;
	while(getline(iss, tmp, delim)) res.push_back(tmp);
	return res;
}

int main(void) {
	string s;

	while (true) {
		getline(cin, s);
		if (s == "END OF INPUT") break;
		
		vector<string> ws = split(s, ' ');
		for (auto w : ws) {
			cout << w.size();
		}
		cout << endl;
	}

	return 0;
}

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

using namespace std;

int main()
{
	string str;

	while (getline(cin, str))
	{
		if(str == "END OF INPUT")    break;
		
		int cont = 0;
		for (int i=0; str[i] != '\0'; i++)
		{
			if(str[i] == ' ') {
				cout << cont;
				cont = 0;
			} else {
				cont++;
			}
		}

		cout << cont << endl;
	}

	return 0;
}

C++: #include <stdio.h>
#include<math.h>
#include <algorithm>
using namespace std;

int main(){
	char buf[100000];
	int length;

	while(true){
		fgets(buf,10000,stdin);
		if(buf[0] == 'E' && buf[1] == 'N' && buf[2] == 'D' && buf[3] == ' ' &&
				buf[4] == 'O' && buf[5] == 'F' && buf[6] == ' ' && buf[7] == 'I' &&
				buf[8] == 'N' && buf[9] == 'P' && buf[10] == 'U' && buf[11] == 'T')break;
		length = 0;
		for(int i=0;buf[i] != '\n';i++){
			if(buf[i+1] == '\n'){
				length++;
				printf("%d",length);
			}else if(buf[i] == ' '){
				printf("%d",length);
				length = 0;
			}else{
				length++;
			}
		}
		printf("\n");
	}


    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 ) {
            cnt = 0;
            for ( ; i < n; ) {
                if ( s[i] == ' ' ) break;
                cnt ++;
                i ++;
            }
            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>
#include<vector>

using namespace std;

char *c;
int n;

int main() {
	string s;
	string a = "OUT OF INPUT";

	while (1) {
		getline(cin, s);
		if (s == a) {
			cout << endl;
			break;
		}
		n = s.length();
		int series = 0;
		for (int i = 0; i < n; i++) {
			if (s[i] == ' ') {
				if (i > 0) {
					if (s[i - 1] == ' ') {
						cout << "0";
						continue;
					}

				}
				cout << series;
				series = 0;
				continue;
			}
			series++;
			if (i == n - 1)
				cout << series;
		}
		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 {
                    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;
}