// Arup Guha
// 11/23/2024
// Solution to Run Length Encoding Run on Kattis

import java.util.*;

public class runlengthencodingrun {

	public static void main(String[] args) {
	
		// Get input.
		Scanner stdin = new Scanner(System.in);
		char[] action = stdin.next().toCharArray();
		char[] str = stdin.next().toCharArray();
		
		// encode.
		if (action[0] == 'E') {
			
			int i = 0;
			
			// Go through whole string.
			while (i < str.length) {
				
				// Count until we are to the next unique character.
				int j = i;
				while (j < str.length && str[i] == str[j]) j++;
				
				// Print out character and # of times.
				System.out.print(str[i]+""+(j-i));
				
				// Update current position.
				i = j;
			}
			System.out.println();
			
		}
		
		// De code.
		else {
			
			// Go through the pairs.
			for (int i=0; i<str.length; i+=2) 
				for (int j=0; j<str[i+1]-'0'; j++)
					System.out.print(str[i]);
			System.out.println();
			
		}
		
		
		
	}
}