General multireference F12 code