Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	for sc.Scan() {

		str := sc.Text()

		if str == "END OF INPUT" {
			break
		}

		strs := strings.Split(sc.Text(), " ")

		for _, s := range strs {
			fmt.Print(len(s))
		}

		fmt.Println()
	}

}

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;
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int main()
{
	for(string s;getline(cin,s),s!="END OF INPUT";){
		istringstream iss(s);
		for(string s;iss>>s;)
			cout<<s.size();
		cout<<endl;
	}
	
	return 0;
}

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

using namespace std;

int main() {
	string temp;
    int ct=0;
    while(1){
        getline(cin,temp);
        if(temp=="END OF INPUT"){break;}
        for(int i=0;i<temp.size();i++){
            if(temp.substr(i,1)==" "){
                cout << ct;
                ct=0;
            } else if(i==temp.size()-1){
            	cout << ct+1;
            	ct=0;
            } else {
            	ct++;
            }
        }
        cout << endl;
    }
}

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


int main(){
	char ss[1000],out[1000],syuu[16];
	int i,j,a,flag;
	strcpy(syuu,"END OF INPUT");
	
	while(fgets(ss,sizeof(ss),stdin)!=NULL){
				
		for(i=0;;i++){
			if(ss[i]=='\0')break;
			if(ss[i]<32)ss[i]='\0';
		}
		
		if(0==strcmp(ss,syuu))break;
		
		i=0;
		j=0;
		flag=0;
		if(ss[0]==' '){
			flag=1;
			out[0]=0+'0';
			i=1;
			j=1;
			out[1]='\0';
		}

		while(1){
			if(ss[i]=='\0')break;
			if(0!=i)++i;
			if(flag==1){
				--i;
				flag=0;
			}
			for(a=0;;a++){
				if(ss[a+i]==' ' || ss[a+i]=='\0')break;
			}
			
			out[j]=a+'0';
			out[j+1]='\0';
			if(ss[a+i]=='\n')--out[j];
			++j;
			i=i+a;
		}
		printf("%s\n",out);
	}
	return 0;
}

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

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

C++: #include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
#include<string.h>

using namespace std;

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

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[1001], *s;
  while(fgets(buf, sizeof(buf), stdin)!=NULL){
    buf[strlen(buf)-1] = '\0';
    if(strcmp(buf,"END OF INPUT")==0) break;
    printf("%d", strlen(strtok(buf, " ")));
    while((s = strtok(NULL, " ")) != NULL){
      printf("%d", strlen(s));
    }
    puts("");
  }
  return 0;
}

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

int main( void )
{
    string line;
    while ( getline( cin, line ) && line != "END OF INPUT" ) {
        istringstream is( line );
        string word;
        while ( is >> word ) {
            cout << word.size();
        }
        cout << endl;
    }
    return 0;
}