There are 4 possible line-ups by gender, B=boy, G=girl: BGBGBG GBGBGB BGGBGB BGBGGB For each of those 4 line-ups by gender, The 3 girls can be arranged in 3! or 6 ways The 3 boys can also be arranged in 3! or 6 ways. That's (4)(3!)(3!) = (4)(6)(6) = 144 ways. Edwin