with open("2", "w") as target:
with open("1") as source:
for num in source:
if num.strip().endswith('0'):
target.write(num)
with open("2", "w") as target:
with open("1") as source:
target.write(''.join(num for num in source.readlines() if not int(num.strip())%10))