(function (input) {
    var inputs = input.replace(/\r/g, '').split("\n"), str, n, prev;
    while(true) {
        n = parseInt(inputs.shift());
        if(n === 0) {
            break;
        }
        str = inputs.shift();
        for(var i = 0; i < n; i++) {
            var tmp = '';
            prev = {
                char: str.charAt(0),
                repeat: 0
            };
            for(var j = 0, len = str.length; j < len; j++) {
                if(prev.char === str.charAt(j)) {
                    prev.repeat++;
                } else {
                    tmp += prev.repeat.toString() + prev.char;
                    prev = {
                        char: str.charAt(j),
                        repeat: 1
                    };
                }
            }
            tmp += prev.repeat.toString() + prev.char;
            str = tmp;
        }
        console.log(str);
    }
})(require("fs").readFileSync("/dev/stdin", "utf8"));