Combinate multiple columns

Hello everybody.

I am new in LibreOffice world and my research is not going anywhere, please help me with my task below:

I have 3 colums with different data and different sizes, I would like to get in 3 different columns all the combinations possible, for example:

INPUT:

-A-- B-- C–

| 1 | A | dog |

| 2 | B | cat |

| 3 | — | — |

OUTPUT:

-A-- B-- C–

| 1 | A | dog |

| 1 | A | cat |

| 1 | B | dog |

| 1 | B | cat |

| 2 | A | dog |

| 2 | A | cat |

| 2 | B | dog |

| 2 | B | cat |

| 3 | A | dog |

| 3 | A | cat |

| 3 | B | dog |

| 3 | B | cat |

As you can see the output can be pretty big, so I want to automate all the manual work of copy/paste, is there any tool like Macros, VB or similar that you could point me to accomplish this goal?

Any assistance will be appreciated!