On a circle, points $A,B,C,D$ lie counterclockwise in this order.  Let the orthocenters of $ABC,BCD,CDA,DAB$ be $H,I,J,K$ respectively.  Let $HI=2$, $IJ=3$, $JK=4$, $KH=5$.  Find the value of $13(BD)^2$.
1. Given that points \(A, B, C, D\) lie counterclockwise on a circle, and the orthocenters of triangles \(ABC, BCD, CDA, DAB\) are \(H, I, J, K\) respectively. We are given the distances \(HI = 2\), \(IJ = 3\), \(JK = 4\), and \(KH = 5\).

2. It is a known result in geometry that the quadrilateral formed by the orthocenters of four triangles inscribed in a circle is congruent to the quadrilateral formed by the vertices of those triangles. Therefore, quadrilateral \(HIJK\) is congruent to quadrilateral \(ABCD\). This implies that the side lengths of \(ABCD\) are \(DA = 2\), \(AB = 3\), \(BC = 4\), and \(CD = 5\).

3. We need to find the value of \(13(BD)^2\). To do this, we will use the Law of Cosines in two different triangles to find \(BD^2\).

4. First, consider triangle \(ABD\). By the Law of Cosines:
   \[
   BD^2 = AB^2 + AD^2 - 2 \cdot AB \cdot AD \cdot \cos(\angle BAD)
   \]
   Substituting the given values:
   \[
   BD^2 = 3^2 + 2^2 - 2 \cdot 3 \cdot 2 \cdot \cos(\angle BAD)
   \]
   \[
   BD^2 = 9 + 4 - 6 \cos(\angle BAD)
   \]
   \[
   BD^2 = 13 - 6 \cos(\angle BAD)
   \]

5. Next, consider triangle \(BCD\). By the Law of Cosines:
   \[
   BD^2 = BC^2 + CD^2 - 2 \cdot BC \cdot CD \cdot \cos(\angle BCD)
   \]
   Substituting the given values:
   \[
   BD^2 = 4^2 + 5^2 - 2 \cdot 4 \cdot 5 \cdot \cos(\angle BCD)
   \]
   \[
   BD^2 = 16 + 25 - 40 \cos(\angle BCD)
   \]
   \[
   BD^2 = 41 - 40 \cos(\angle BCD)
   \]

6. Since \(\angle BAD\) and \(\angle BCD\) are supplementary angles (they add up to \(180^\circ\)), we have \(\cos(\angle BAD) = -\cos(\angle BCD)\).

7. Equating the two expressions for \(BD^2\):
   \[
   13 - 6 \cos(\angle BAD) = 41 - 40 \cos(\angle BCD)
   \]
   \[
   13 - 6 \cos(\angle BAD) = 41 + 40 \cos(\angle BAD)
   \]
   \[
   13 - 41 = 6 \cos(\angle BAD) + 40 \cos(\angle BAD)
   \]
   \[
   -28 = 46 \cos(\angle BAD)
   \]
   \[
   \cos(\angle BAD) = -\frac{28}{46} = -\frac{14}{23}
   \]

8. Substituting \(\cos(\angle BAD) = -\frac{14}{23}\) back into the expression for \(BD^2\):
   \[
   BD^2 = 13 - 6 \left(-\frac{14}{23}\right)
   \]
   \[
   BD^2 = 13 + \frac{84}{23}
   \]
   \[
   BD^2 = 13 + \frac{84}{23} = \frac{299}{23}
   \]

9. Finally, we need to find \(13(BD)^2\):
   \[
   13(BD)^2 = 13 \cdot \frac{299}{23} = \frac{3887}{23} = 169
   \]

The final answer is \(\boxed{169}\).