Sergey attend lesson nish language each lesson receive hometask this time task translate sentence nish language sentence nish language represent string consist lowercase Latin letter space punctuation marksSergey totally forget task half hour lesson hastily scribble but recollect lesson learn grammar Nish the spelling rule state Nish contain forbidden pair letter letter occur sentence also order letter do not matter example pair letter ab forbid occurrence substrings ab ba forbid also pair different letter letter occurs forbid pairNow Sergey want correct sentence do not contain forbidden pair letter stand however run time decide simply cross letter sentence what small number letter cross when letter cross remove letter leave right exist neighbor for example cross letter string aba string ba cross second letter aa