print"$System.in".replaceAll(/(\w)( \1)*/,'[$0]')