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>
using namespace std;

int main() {
    const string endLine = "END OF INPUT";
    while (true) {
        string line;
        getline(cin, line);
        if (line == endLine) {
            break;
        }
        while (line.length() > 0) {
            int spacePos = (int) line.find_first_of(' ');
            if (spacePos == (int) string::npos) {
                cout << line.length();
                line.clear();
            } else {
                cout << spacePos;
                line.erase(0, spacePos + 1);
            }
        }
        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[1000], *s;
  while(fgets(buf, sizeof(buf), stdin)){
    if(strcmp(buf,"END OF INPUT")==0) break;
    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;
    s = strtok(buf, " \n");
    while(s != NULL){
      printf("%d", (int)strlen(s));
      s = strtok(NULL, " \n");
    }
    puts("");
  }
  return 0;
}

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

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 <vector>
#include <string>
#include <sstream> 
#include <algorithm>

using namespace std;

string solve(string str) {
    string ans;

    // split
    vector<string> results;    
    stringstream ss(str);
    string buffer;
    char sep = ' ';
    while( std::getline(ss, buffer, sep) ) {
        results.push_back(buffer);
    }

    const int size = results.size();
    for (int i = 0; i < size; ++i) {   
        string tmp = to_string(results[i].length());
        ans += tmp;
    }

    return ans;
}

int main(int argc, char const *argv[]) {
    string str;
    const string end("END OF INPUT");

    while (getline(cin, str), str != end) {
        cout<<solve(str)<<endl;
    }
    return 0;
}

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

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(getline(cin, str)){
		if(str=="END OF INPUT")break;
		stringstream ss;
		ss <<str;

		while(ss>>str){
			int x =str.length();
			cout <<x;
		}
		cout<<endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
    string a;
    while (getline(cin,a)&&a!="END OF INPUT"){
        int num=0;
        for(int i=0;i<a.length();++i){
            if(a[i]==" ") {
                cout << num;
                num=0;
            }else num++;
        }
        cout << cnt << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
main(){
  string s;
  while(getline(cin,s),s!="END OF INPUT"){
    for(int i=0,n=0,l=s.size();i<=l;i++){
      if(i==l||s[i]==' '){cout<<n;n=0;}
      else n++;
    }
  }
}

C++: #include<iostream>
#include<string>
using namespace std;
string S, T; int chain;
int main() {
	while (true) {
		getline(cin, S);
		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++: // AOJ 1042
#include<iostream>
#include<sstream>
#include<string>

int main()
{
	std::string s;
	while( std::getline( std::cin, s ), s != "END OF INPUT" )
	{
		std::istringstream iss( s );
		std::string t;
		while( iss >> t )
			std::cout << t.size();
		std::cout << std::endl;
	}

	return 0;
}

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

int main(){
  string data;
  int count, p;

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

    count=0;
    p=0;
    for(int i=0;i<data.size();i++){
      if(data[i]==' '){
	p++;
	if(p==2){
	  //cout << 0;
	}
	cout << count;
	count=0;
	continue;
      }
      count++;
    }
    cout << count;
    cout << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
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.length(); i++){
            if(s[i] != ' ') c++;
            else   cout << c, c = 0;
        }
        cout << c << endl;
    }   
    return 0; 
}

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

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