I can't seem to figure out how to copy my header row from master to matched... I need to grab the first row in my master csv and write it first in matched, then write the remaining lines if they match the criteria...

```
with open('master.csv', 'r') as master, open('match.csv', 'w') as matched:
    for line in master:
            if any(city in line.split('","')[5] for city in citys) and \
            any(state in line.split('","')[6] for state in states) and \
            not any(category in line.split('","')[2] for category in categorys):
                matched.write(line)

```

Please help. I am new to python and don't know how to use pandas or anything else...