In the diagram, four squares of side length 2 are placed in the corners of a square of side length 6. Each of the points $W$, $X$, $Y$, and $Z$ is a vertex of one of the small squares. Square $ABCD$ can be constructed with sides passing through $W$, $X$, $Y$, and $Z$. What is the maximum possible distance from $A$ to $Z$?

We begin by drawing a diagram.

2005 AIME II-12.png
We are trying to maximize $AZ$, so extend $AZ$ such that it hits $BC$. Call the point of intersection $M$. Now, we've got $\triangle ABM$ with a side length of $3$ (from $AB = 6$ and $AZ = 3$), and since $M$ is the midpoint of $AZ$, the height of the triangle going up from $M$ is $3.$ Let this distance be $x$. Since the area of a triangle is $\frac{1}{2} bh$, we know the area of $\triangle ABM = \frac{1}{2} \cdot 3 \cdot x = \frac{3x}{2}$. However, we can also compute the area of $\triangle ABM$ in another way, by subtracting out areas. The area of $\triangle ABC = \frac{6^2}{2} = 18$, and the area of $\triangle ABW = 1$, so $\triangle ABM = 18 - 1 = 17$. Since we know these two expressions for the area of $\triangle ABM$, set them equal: $\frac{3x}{2} = 17.$ Multiplying by $\frac{2}{3}$ gives $x = \frac{34}{3}$. Since we want $AZ$, and $M$ is the midpoint of $AZ$, then we just need to add $x$ to $\frac{3}{2}$, which equals $\frac{34}{3} + \frac{3}{2} = \frac{51 + 9}{6} = \boxed{10}$.