It doesn't. You can only move down or right, you can't wrap around the grid yourself (only the rows cyclically shift). So the only way to get to cell $(i, 0)$ is from cell $(i - 1, 0)$, and so $g(i, 0, x)$ depends only on $f(i - 1, 0)$.
It doesn't. You can only move down or right, you can't wrap around the grid yourself (only the rows cyclically shift). So the only way to get to cell $(i, 0)$ is from cell $(i - 1, 0)$, and so $g(i, 0, x)$ depends only on $f(i - 1, 0)$.