Generally speaking the earth wire for the fans will most likely be brown, so I would think those in the pic are the two lives (A) and (B) to the fans so both should connect to pin 87 but can't remember the colours of hand as it was a while since I done mine.
The only thing I would do different is your relay wiring you should have to lives going to relay and the earth should be switched by the relay as opposed to the live, this is as per the original design.
I.E have another live going to pin 85 and run the earth 86 to the fan switch and the other side of the switch to a good earth.
Martin