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>
#include<cstdio>
using namespace std;
int main(){
	string s;
	while(getline(cin,s)){
		if(s=="END OF INPUT")break;
		int count=0;
		for(int i=0;i<s.size();i++){
			count++;
			if(s[i]==' '){
				printf("%d",count-1);
				count=0;
			}
		}
		cout<<count<<endl;
	}
	return 0;
}

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

int main(void)
{
  string line;
  while (true)
  {
    getline(cin, line);
    if ( line == "END OF INPUT" ) break;

    int count = 0;
    for (int i = 0, size = line.size(); i < size; i++)
    {
      if (line[i] != ' ')
      {
        count++;
      }
      else
      {
        cout << count;
        count = 0;
      }
    }
    cout << count << endl;
  }
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define between(a,x,b) ((a)<=(x)&&(x)<=(b))
using namespace std;

int main(){
  char str[1024];
  while(1){
    fgets(str, sizeof(str), stdin);
    str[strlen(str)-1] = ' '; str[strlen(str)] = '\0';
    if(strcmp(str, "END OF INPUT ") == 0) return 0;
    int cnt = 0;
    for(int i = 0; i < strlen(str); ++i){
      if(str[i] == ' '){ printf("%d", cnt); cnt = 0;continue;}
      cnt++;
    }
    puts("");
  }
  return 0;
}

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

using namespace std;

int main()
{
    string s;
    while (getline(cin, s), s != "END OF INPUT") {
        stringstream ss(s);
        string t;
        while (ss >> t) {
            cout << t.size();
        }
        cout << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
using namespace std;
int main()
{
	char s[257];
	int i, c;
	while (cin.getline(s, sizeof(s)))
	{
		if (!strcmp(s, "END OF INPUT"))
			break;
		for (i = c = 0; i < strlen(s); i++)
		{
			if (s[i] == ' ' && s[i+1] != '\0')
			{
				cout << c;
				c = 0;
			}
			else
				c++;
		}
		cout << c << endl;
	}
}

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

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a,c) memset(a,c,sizeof(a))

#define DEBUG(x) cout<<"#x"<<": "<<x<<endl

using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;

const ll INF = INT_MAX/3;
const ll MOD = 1000000007;
const double EPS = 1e-14;
const int dx[] = {1,0,-1,0} , dy[] = {0,1,0,-1};

int main(){
    while(true){
	string s;
	string ans = "";
	getline(cin,s);
	if(s == "END OF INPUT") break;
	s = ' ' + s + ' ';
	REP(i,s.size()){
	    FOR(j,i+1,s.size()){
		if(s[j] == ' ') {
		    ans += to_string(j-i-1);
		    i = j;
		}
	    }
	}
	cout << ans << endl;

    }

    return 0;
}

C++: #include<iostream>
#include<set>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string a;
	while (getline(cin,a)&&a != "END OF INPUT") {
		string h="";
		string g= "";
		a += " ";
		for (int i = 0; i < a.length(); i++) {
			if (a[i] == ' ') {
				g+=to_string(h.length());
				h = "";
			}
			else
				h += a[i];
		}
		cout <<g<< endl;
	}
}