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<algorithm>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define REP(i,a,n) for(int i = a ; i < n ; i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

int main(){
  string s;

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

C++: #include <iostream>
using namespace std;
int main(){
	string s;
	while(getline(cin,s)){
		string ans="";
		if(s=="END OF INPUT")break;
		if(s==""){ans="0";break;}
		bool backsp = true;
		int count = 0;
		for(int i=0;i<s.size();++i){
			if(('A'<=s[i]&&s[i]<='Z')||('a'<=s[i]&&s[i]<='z')){
				if(backsp){
					backsp=false;
					count=1;
				}else{
					count++;
				}
				if(i==s.size()-1)ans+=('0'+count);
			}else if(s[i]==0x20){
				if(!backsp){
					backsp=true;
					ans+=('0'+count);
				}else{
					ans+="0";
				}
			}
		}
		cout<<ans<<"\n";
	}
}

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

using namespace std;

int main()
{
  string line;

  while (1) {
    getline(cin, line);
    if (line == "END OF INPUT") return 0;
    string word;
    stringstream ss(line);
    char delim = ' ';
    while (getline(ss, word, delim)) {
      cout << word.length();
    }
    cout << endl;
  }
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(ll i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(ll i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)
 
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007


vector<string> split(const string &s, char c = ' '){
	vector<string> ret;
	stringstream ss(s);
	string t;
	while(getline(ss,t,c)){
		ret.pb(t);
	}
	return ret;
}



int main(){
	string s;
	while(getline(cin,s)){
		if(s == "END OF INPUT") break;
		vector<string> v = split(s);
		for(int i = 0; i < v.size(); i++) cout<<v[i].size();
		cout<<endl;
	}
}

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

int main(void){
	char input[1024];
	char END[]={"END OF INPUT"};
	int n,n2;
	int kuhaku=1;
	int cnt=0,i;

	while(1){
		fgets(input,sizeof(input),stdin);
		n=strlen(input);
		n2=strlen(END);
		for(i=0;i<n2;i++){//I¹ð
			if(input[i]==END[i]){
				cnt++;	
			}
			if(cnt>=12){
				return 0;
			}
		}

		cnt=0;
		for(i=0;i<n;i++){
			cnt++;
			if(input[i]==' '){
				if(input[i+1]!=' '){
					printf("%d",cnt);
					cnt=0;
				}else{
					kuhaku++;
					if(kuhaku>=3 && input[i+1]!=' '){
						printf("%d",0);
						kuhaku=0;
					}
				}
			}
		}
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  string line;
  while(getline(cin,line)){
    if(line=="END OF INPUT") break;
    if(line==""){
      cout<<0<<endl;
      continue;
    }
    stringstream ss;
    ss<<line;
    string word;
    while(ss>>word){
      cout<<word.size();
    }
    cout<<endl;
  }
  return 0;
}

C++: #include<iostream>

#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)

using namespace std;

int main(){
  string buff;

  while(getline(cin, buff), buff != "END OF INPUT"){
    int cnt = 0;
    FOR(it, buff){
      if(*it == ' '){
	cout << cnt;
	cnt = 0;
      }else{
	++cnt;
      }
    }
    if(cnt) cout << cnt;
    cout << endl;
  }

  return 0;
}

C++: #include <stdio.h>
int main() {char T[9999];int i=0;while (1) {T[i]=getchar();if (T[i]=='\n') {
	if (T[0]=='E' && T[1]=='N' && T[2]=='D' && T[3]==' ' && T[4]=='O' && T[5]=='F' && T[6]==' ' && T[7]=='I' && T[8]=='N' && T[9]=='P' && T[10]=='U' && T[11]=='T') return 0;
	T[i]=' ';for (int j=0,cnt=0;j<=i;j++) if (T[j]!=' ') cnt++;else if (cnt) printf("%d",cnt),cnt=0;puts("");i=0;} else i++;}}

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

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

int main(){
  char buf[1000], *s, end[16];
  strcpy(end, "END OF INPUT");
  while(fgets(buf, sizeof(buf), stdin)){
    if(strcmp(buf,end)==0) break;
    s = strtok(buf, " \n");
    while(s != NULL){
      printf("%d", (int)strlen(s));
      s = strtok(NULL, " \n");
    }
    puts("");
  }
  return 0;
}

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