Combination Formula with a lockout twist

Combination Formula with a "lockout" twist

Hi! I am trying to figure out all possible combonations for 6 items among a group of 18 choices. So I turn to my old friend C(n,r) to calculate where n=18 and r=6. "But WAIT!" I tell you before you hastily begin scribbling, "There is a twist..." You see my problem is that the items are divided up into 6 groups, with 3 choices in each group. Once a choice has been made in a group for the combination the other 2 in the group are unavailable, or "locked out" of the rest of the combination. The order doesn't necessarily matter but a choice must be selected from each of the six groups. Here's a visual representation:

A B C
1 A1 B1 C1
2 A2 B2 C2
3 A3 B3 C3
4 A4 B4 C4
5 A5 B5 C5
6 A6 B6 C6

If "B1" is selected in a single combination then "A1" and "C1" cannot be apart of the same combination. What is the formula for this and how many possible combinations are there?

Stephen Tashi
Do you have 18 distinct items? The answer is $3^6$.