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 <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

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> ss=split(s,' ');
		string ans="";
		//rep(i,0,ss.size()) cout<<ss[i].size();
		//cout<<endl;
		rep(i,0,ss.size()){
			stringstream stream;
			stream<<ss[i].size();
			ans+=stream.str();
		}
		o(ans);
	}
}

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

void split(string& str, vector<string>& v){
  string::size_type index_space = str.find_first_of(" ");
  if(index_space!=string::npos){
    v.emplace_back(str.substr(0,index_space));
    string s(str.substr(index_space+1));
    split(s, v);
  }else{
    v.emplace_back(str);
  }
  return;
}

int main(){
  while(true){
    string str; getline(cin,str);
    if(str=="END OF INPUT") break;
    vector<string> v;
    split(str,v);

    for(int i=0;i<v.size();++i){
      if(v[i]==",") cout<<".";
      else cout<<v[i].size();
    }
    cout<<endl;
  }

  return 0;
}

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

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

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 <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;
		stringstream ss;
		ss <<str;

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

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

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> ss=split(s,' ');
		string ans="";
		rep(i,0,ss.size()) cout<<ss[i].size();
		cout<<endl;
		/*rep(i,0,ss.size()){
			stringstream stream;
			stream<<ss[i].size();
			ans+=stream.str();
		}
		o(ans);*/
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	
	cin.tie( 0 );
	ios::sync_with_stdio( false );
	
	string s;
	
	while( getline( cin, s ) ){
		
		if( s == "END OF INPUT" ){ return 0;}
		
		s += ' '; //add SP
		int count {0};
		vector<int> vc;
		
		for( int i = 0; i < (int)s.size(); i++ ){
			
			if( s[i] != ' ' ){
				count++;
				continue;
			}
			
			vc.push_back( count );
			count = 0;
		
		}
		
		for( auto x : vc ){
			cout << x;
		}
		
		cout << endl;
		
	}
	
	return 0;

}

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

int main(){
  string str;

  for(;;){
    getline(cin,str);
    if(str == "END OF INPUT")break;
    
    int pos = 0;
    int ans = 0;
    while(pos<(int)str.size()){
      if(str[pos]==' '){
	cout << ans;
	ans = 0;
      }else ans++;
      pos++;
    }
    cout << ans << endl;
  }
}

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

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

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

//split delimiter??§?????????
vector<string> split(const string& s, char delimiter) {
	vector<string> ret;
	string w;
	for (char c : s) {
		if (c == delimiter) {
			if (!w.empty())	ret.push_back(w);
			w.clear();
		}
		else w += c;
	}
	if (!w.empty())	ret.push_back(w);
	return ret;
}

signed main() {
	for (string s; getline(cin, s) && s != "END OF INPUT";) {
		vector<string> t(split(s, ' '));
		rep(i, 0, t.size())cout << t[i].size();
		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"){
        stringstream ss(s);
        int f=false;
        string t;
        while(ss >> t){
            if(f)cout<<" ";
            cout << t.size();
        }
        cout << endl;
    }
}