prints ids to file