It is admittedly tricky. I haven't done this sort of thing in a while so I don't remember if there is a systematic method.
Anyway, for starters, you have to remember that the solution for V is a sum of products with different values of k, as I wrote in my previous post. Finding out that [itex]A_k = B_k[/itex] is a good start. The next thing I'd think about is what values of k are allowed.
Consider a fixed value of x. At that fixed x, the potential will form some function in y. Your expression for that function is basically a Fourier series,
[tex]V(x_0, y) = \sum_i C_i' \cos(k_iy) + D_i' \sin(k_iy)[/tex]
where
[tex]C_i' = 2A_i C_i[/tex]
and similarly for Di'. Now, when you're writing a Fourier series for a function that has a domain of width a, do you know what the possible values of k are? (Hint: this is equivalent to writing the series for a function that is periodic with period a.)