Yasha writes in the cells of a $99 \times 99$ table all positive integers from 1 to $99^2$, with each number appearing once. Grisha looks at the table and selects several cells such that no two selected cells share a common side. Grisha then sums up the numbers in all the selected cells. Determine the largest sum that Grisha can guarantee to achieve.

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