import re

s = 'A B     C  D \n EF   G'
print(re.sub(r"[^\S\r\n]{2,}", " ", s))
