Frankie the Frog starts his morning at the origin in $\mathbb{R}^2$. He decides to go on a leisurely stroll, consisting of $3^1 + 3^{10} + 3^{11} + 3^{100} + 3^{111} + 3^{1000}$ moves, starting with the first move. On the $n$th move, he hops a distance of $$\max\{k\in\mathbb{Z}:3^k|n\}+1,$$ then turns $90^{\circ}$ counterclockwise. What is the square of the distance from his final position to the origin?

Let's think step by step and output the final answer within \boxed{}.
user