The event can happen in two possible ways - the first ball chosen is red and the second one is black or vice versa.

For bag A, the probability that first ball is red and second ball is black is

6/10 x 4/9 =4/15

For bag A, the probability that the first ball is black and the second ball is red is 4/10 x 6/9=4/15.

The total probability for bag A is therefore 4/15+4/15=8/15

Similarly the total probability for bag B can be found to be 7/30+7/30=7/15.

The probability that bag A is selected from throwing the die is 1/3 and the probability that bag B is selected is 2/3

So, the total probability of the occurence of this event is

1/3 x 8/15 x 2/3 x 7/15= 22/45