using System.Collections;
public static void Main()
var input = "aabcccccccd";
var hash = new Hashtable();
for (var i = 0; i < input.Length; i++){
if (hash.ContainsKey(input[i])){
hash[input[i]] = (int)hash[input[i]] + 1;
var str = new StringBuilder();
foreach (var key in hash.Keys){
str.Append(String.Format("{0}{1}", key, hash[key]));
if (str.Length > input.Length) {
Console.WriteLine(input);