package finalset;

import java.util.Scanner;

/**
 * Left-to-Right sequence
 * 
 * You are to write a program that takes as input a String of numbers, S0, and then calculates
 * the next ten terms of the sequence (S1 through S10) where sequence term Sn+1 is derived
 * by "describing" term Sn.
 * 
 * For example, if S0 is "12444221" then we describe this from left to right as follows:
 * 
 *    "one 1, one 2, three  4's, two 2's, one 1."
 * 
 * Which results in S1 value of "1112342211"
 * 
 * The integer sequence beginning with a single digit in which the next term
 * is obtained by describing the previous term. 
 */
public class Problem2 {

	/**
	 * Move forward.
	 * 
	 * @param num
	 */
	public static String compute (String num) {
		StringBuffer result = new StringBuffer();
		int idx = 0;
		int ct = 0;
		boolean done = false;
		while (!done) {
			char c = num.charAt(idx++);
			ct = 1;
			
			// see how many appear in a row.
			while (!done) {
				if (idx < num.length()) {
					if (num.charAt(idx) == c) {
						ct++;
						idx++;
					} else {
						break;
					}
				} else {
					done = true;
				}
			}
			
			// output
			result.append ("" + ct + c);
		}
		
		return result.toString();
	}

	// helper function for testing.
	public static String process (String in) {
		String res = "";
		for (int i = 0 ; i < 5; i++) {
			in = compute(in);
			res += in + "\n";
		}

		return res;
	}
	
	public static void main (String args[]) {
		Scanner sc = new Scanner (System.in);
		String s = sc.nextLine();
		String t = process (s);
		System.out.println(t);
	}
}
