  Three-loop vertex diagrams in HQET needed for sum rules for B^0 - \bar{B}^0
mixing are considered. They depend on two residual energies. An algorithm of
reduction of these diagrams to master integrals has been constructed. All
master integrals are calculated exactly in d dimensions; their epsilon
expansions are also obtained.
