find line to devices and devices to line