Each of the five numbers $1, 4, 7, 10$, and $13$ is placed in one of the five squares so that the sum of the three numbers in the horizontal row equals the sum of the three numbers in the vertical column. What is the largest possible value for the horizontal or vertical sum?

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