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>
#include<vector>

using namespace std;

char *c;
int n;

int main() {
	string s;
	string a = "END OF INPUT";

	while (1) {
		getline(cin, s);
		if (s == a) {
			//cout << endl;
			break;
		}
		n = s.length();
		int series = 0;
		for (int i = 0; i < n; i++) {
			if (s[i] == ' ') {
				if (i > 0) {
					if (s[i - 1] == ' ') {
						cout << "0";
						continue;
					}

				}
				cout << series;
				series = 0;
				continue;
			}
			series++;
			if (i == n - 1)
				cout << series;
		}
		cout << endl;
	}


	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>

using namespace std;

int main() {

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

	int index = 0;
	for ( char& ch : line ) {
	  if ( ch == ' ' ) {
		cout << index;
		index = 0;
	  } else {
		index++;
	  }
	}
	cout << index << endl;
  }  
}

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

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

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

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

C++: #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    string s;
    while(true){
        getline(cin,s);
        if(s == "END OF INPUT") break;
        string div;
        s+=' ';
        rep(i,s.size()){
            if(s[i] == ' '){
                cout << div.size();
                div = "";
            }else{
                div+=s[i];
            }
        }
        cout << 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 << cnt << endl;
    }
}

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

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

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

int main() {
    string str;
    while (getline(cin, str)) {
        if (str[str.size()-1] == '\n') str.resize(str.size()-1);
        if (str == "END OF INPUT") break;
        stringstream ss;
        ss << str;
        ss << '\n';
        string s;
        while (ss >> s) cout << s.size();
        cout << endl;
    }

    return 0;
}

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

using namespace std;

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

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

using namespace std;

int main(){
  string str;
  while(cin >> str){
    if(str == "END_OF_INPUT") break;
    str += " ";
    int idx = 0;
    while(idx < str.size()){
      int cnt = 0;
      while(str[idx++]!=" ") cnt++;
      cout << cnt;
    }
    cout << endl;
  }
}

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

int main() {
	string s;
	while (getline(cin,s)) {
		if (s == "END OF INPUT")break;
		else {
			int sa=0;
			queue<int>q;
			for (int i = 0;i < s.size();i++) {
				if (s[i] != ' ')sa++;
				else {
					q.push(sa);
					sa = 0;
				}
			}
			q.push(sa);

			int b = q.size();

			for (int i = 0;i < b;i++) {
				cout << q.front();
				q.pop();
			}
			cout << endl;
		}
	}
	return 0;
}

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

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

using namespace std;

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

C++: #include <bits/stdc++.h>

#define reps(v, f, l) for (int v = (f), v##_ = (l); v < v##_; ++v)
#define rep(v, n) reps(v, 0, n)
#define lep(v, n) reps(v, 1, n + 1)

using namespace std;

typedef long long int lint;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }
template<typename T> void show(T& a, char del='\n', char last='\n'){ rep(i, a.size() - 1) cout << a[i] << del; cout << a[a.size() - 1] << last; }

vector<string> split(const string& S)
{
  istringstream stream(S);
  string field;
  vector<string> result;
  while (getline(stream, field, ' ')){
    result.push_back(field);
  }
  return result;
}

int main()
{
  string str;
  while (getline(cin, str), str != "END OF INPUT"){
    vector<string> ss = split(str);
    rep(i, ss.size()){
      printf("%d", ss[i].size());
    }
    puts("");
  }

  return 0;
}

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{
				cout << len;
				len = 0;
			}
		}
		cout << len-1 << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int main(){

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