parse input lines into lists