Generate a grammar without context from a language

I have to give a grammar without context for each of the examples:

$ L_1 = {a ^ hb ^ ka ^ mb ^ n: h + k = m + n } $

$ L_2 = {a ^ ib ^ ja ^ k: (i = j , , , and , , , , k≥0) , , , or , , , , (i ge0 , , , and , , , , , j> k) } $

I've done many simple examples and improved my skills to generate CFG from grammars. I normally start by solving the simplest case, and then continue from there. However, I do not know where to begin to find solutions to these problems.