s = input() sym = s[0] c = 1 for i in s[1:]: if sym == i: c += 1 else: print(sym, c) sym = i c = 1 print(sym, c)