a=io.read'*a':gsub("[%d ]+(%d)[%1 ][%d ]+","%1")print(a)