#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

#define LEN 1000000
char buf[LEN+1];

void dochr (int i)
{
        if (buf[i] == '1')
                printf ("11");
        else 
                printf ("%c", buf[i]);
}

void verbatim (int s, int e)
{
        printf ("1");
        while (s <=e) {
                dochr (s++);
        }
        printf ("1");
}


int main ()
{
        int i;
        FILE * in = stdin;
        while (1) {
                fgets (buf, LEN+1, in);
                if (feof (in))
                        break;
                assert (strlen (buf) < LEN);
                i = 0;
                while (1) {
                        if (buf[i] == '\n')
                                break;
                        if (buf[i+1] == '\n') {
                                verbatim (i, i);
                                break;
                        }
                        if (buf[i+1] == buf[i]) {
                                int e = 2;
                                while (e < 9) {
                                        if (buf[i+e] == buf[i])
                                                e++;
                                        else
                                                break;
                                }
                                printf ("%d%c", e, buf[i]);
                                i += e;
                        } else {
                                int e = i;
                                while (1) {
                                        if (buf[e] == '\n')
                                                break;
                                        if (buf[e] == buf[e+1])
                                                break;
                                        e++;
                                }
                                assert (e > i);
                                verbatim (i, e-1);
                                i = e;
                        }
                }
                printf ("\n");
        }
        return 0;
}

