exactly once (in an arbitrary order). It is clear that for any odd $h$ the upper bound with respect to the number of branched hexagons is attained exactly by the graphs in ${\mathcal{B}}_h  \cup{\mathcal{B}}_h'$ (or ${\mathcal{P}}_h \cup{\mathcal{P}}_h'$).

Moreover, by Lemma \[st\_segmentov\] the graphs in ${\mathcal{B}}_h \cup{\mathcal{P}}_h$ also have the maximum possible number of segments. On the other hand, by applying the same reasoning as in the proof of Lemma \[st\_segmentov\], we deduce that the graphs in ${\mathcal{B}}_{h}'$ (or ${\mathcal{P}}_{h}'$) do not attain the upper bound with respect to the number of segments since the number of segments does not increase when Extension 3 is performed. Therefore, it is clear that $G$ attains the maximum value with respect to the Wiener polarity index if and only if $G \in {\mathcal{B}}_h$ (or $ G \in {\mathcal{P}}_h$).

Concluding remarks
==================

In the paper we have generalized a formula for calculating the Wiener polarity index of a graph. The obtained result can be used for many (molecular) graphs since the conditions in the main theorem do not prohibit $4$-cycles in a considered graph. As an example of the main result, the closed formulas for the Wiener polarity index are calculated for phenylenes and recalculated 