output pairs to separate files