generalize relay picking, w can be any relay rather than just an exit relay, while z must still be an exit relay