It seems from the question context you're using to refer to the non-negative remainder on division, e.g., means , where is an integer, is positive integer and . I'm going to assume this. Also, if so, then note there's no unique answer for , although you can always do something like choose the smallest possible positive value as being the value you want.
To keep the discussion simpler, I'm also going to assume all and all are distinct. In that case, you can have
The first equation comes from that means for all , and similarly for the second equation. The limits on and ensure they will be equal to the remainder when divided by and , respectively, and to meet the question inequality conditions.
Note although (1) and (2) don't necessarily encompass all possible solutions, at least with these 2 modular equations you have the Chinese remainder theorem guaranteeing a solution always exists.
An example which works in all cases is and , i.e.,
Did you like this example?