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 <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<algorithm>
#include<string>
using namespace std;

int main(){

  string s;
  string t;

  while(true){
    getline(cin,s);
    if(s == "END OF INPUT") break;
    t = "";

    for(int i=0;i<=s.size();i++){
      
      if(s[i] == ' '){
	cout << t.size();
	t = "";
      }

      else t += s[i];

    }

    cout << t.size()-1 << endl;

  }
}

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

int main(){
     while(1){
	  string temp;
	  getline(cin,temp);
	  //cout<<temp;
	  if(cin.eof()||temp=="END OF INPUT")break;
	  int sum=0;
	  for(int i=0;i<temp.size();i++){
	       if(temp[i]==' '){
		    cout<<sum;
		    sum=0;
	       }
	       else sum++;
	  }
	  cout<<sum<<endl;
     }
}

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

int main() {
	char s[1000];
	while(true) {
		fgets(s, 1000, stdin);

		if(s[strlen(s)-1] == '\n') {
			s[strlen(s)-1] = '\0';
		}
		if(s[strlen(s)-1] == '\r') {
			s[strlen(s)-1] = '\0';
		}
		if (strcmp(s, "END OF INPUT") == 0) {
			break;
		}
		int len = 0;
		for (int i = 0; i < (int)strlen(s); i++) {
			if(s[i] != ' ') {
				len++;
			}
			else if(len != 0) {
				cout << len;
				len = 0;
			}
		}
		cout << len << endl;
	}
	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(1){
		getline(cin,str);
		if(str=="END OF INPUT")break;
		int cnt = 0;
		for(int i =0;i <str.length();i++){
			if(str[i]==' '){
				cout <<cnt;
				cnt = 0;
			}else{
				cnt++;
			}
		}
		cout <<cnt<<endl;
	}
	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="";
		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;
	}
}

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

using namespace std;

int main()
{
  string str("END OF INPUT");
  int size;

  while(1){
    size = 0;
    string v;
    getline(cin,v);

    if(v == str){
      break;
    }

    for(char e : v){
      if(e == ' '){
        cout<<size;
        size = 0;
      } 
      else{
        size++;
      } 
    }
    cout<<size<<endl;
  }
  return 0;
}

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

using namespace std;

int main(void){
  string s;  

  while(1){
    getline(cin,s);
    if(s=="END OF INPUT")break;

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

  return 0;
}

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

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

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

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  while(true) {
    getline(cin, s);
    if (s == "END OF INPUT") break;
  
    int cnt = 0;
    for (auto c : s) {
      if (c == ' ') {
	cout << cnt;
	cnt = 0;
      }
      else {
	cnt++;
      }
    }
    cout << cnt << 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;
	}
}

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

using namespace std;
int main() {
	string s;
	while (getline(cin, s), s != "END OF INPUT") {
		for (int i = 0, n = 0; i <= s.length(); i++) {
			if (i == s.length() || s[i] == ' ') {
				cout << n;
				n = 0;
			} else {
				n++;
			}
		}
		cout << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    string str;
    while (getline(cin, str)) {
        if (str == "END OF INPUT") break;
        stringstream ss;
        ss << str;
        string s;
        while (ss >> s) cout << s.size();
        cout << endl;
    }

    return 0;
}