How to compress a character using ? command while printing