Urgent Help

Could someone tell me how to code for the below requirement....

A,1,2,3
B,1,4

I would want it as
A 1
A 2
A 3
B 1
B 4

You need to be more specific when asking questions here.

You need to include platform, programming language, input and output.

Also, your posts looks like homework. If you are posting homework, please post per forum rules.