from re import findall
open('2.txt', 'w').write('\n'.join([''.join(findall(r"^(\w+?)\s", line)) for line in open('1.txt').read().split('\n') if findall(r"^(\w+?)\s", line)]))
from re import findall
list_=[]
for line in open('1.txt').read().split('\n'):
symbols = findall(r"^(\w+?)\s", line)
list_.append(''.join(symbols)) if symbols else None
open('2.txt', 'w').write('\n'.join(list_))