<filename>aoc_2020_7.py
from collections import defaultdict
from string import digits

data = '''drab plum bags contain 5 clear turquoise bags, 5 striped aqua bags, 4 dotted gold bags, 4 plaid chartreuse bags.
faded cyan bags contain 1 dim brown bag, 5 wavy magenta bags, 3 vibrant chartreuse bags, 4 muted fuchsia bags.
shiny brown bags contain 4 dark maroon bags.
bright plum bags contain 3 dull tomato bags, 5 bright tan bags, 4 plaid lime bags.
plaid purple bags contain 2 posh black bags.
wavy turquoise bags contain 1 wavy white bag, 5 dotted maroon bags.
dotted aqua bags contain 4 dotted brown bags, 4 dim plum bags.
drab chartreuse bags contain 2 dark olive bags.
vibrant black bags contain 5 mirrored black bags, 3 dark chartreuse bags, 2 muted salmon bags, 1 plaid coral bag.
posh purple bags contain 1 faded white bag, 5 clear gray bags, 4 clear silver bags.
drab coral bags contain 5 dark salmon bags.
wavy silver bags contain 5 dotted turquoise bags, 3 dark bronze bags, 1 muted silver bag.
plaid silver bags contain 2 plaid tomato bags.
dark olive bags contain 5 faded olive bags, 5 dull chartreuse bags, 1 pale gold bag, 3 dull tomato bags.
mirrored lime bags contain 3 dull purple bags, 4 light teal bags.
bright green bags contain 2 pale tan bags, 5 drab tan bags.
posh lavender bags contain 4 posh indigo bags, 5 mirrored brown bags.
muted purple bags contain 2 posh chartreuse bags, 3 faded lime bags, 3 dim chartreuse bags, 2 striped fuchsia bags.
drab gray bags contain 1 striped indigo bag, 2 dim coral bags.
posh olive bags contain 1 dim tomato bag, 4 light gray bags.
posh yellow bags contain 2 posh purple bags.
clear cyan bags contain 1 dotted lime bag, 4 dark bronze bags, 5 wavy lime bags.
clear olive bags contain 2 drab coral bags, 2 bright olive bags, 3 vibrant indigo bags, 1 bright cyan bag.
dotted brown bags contain 2 muted tomato bags.
dim lime bags contain 1 posh purple bag, 3 pale gold bags, 3 light silver bags, 1 dotted turquoise bag.
drab aqua bags contain 4 dim olive bags, 1 light gray bag.
wavy beige bags contain 2 striped indigo bags, 4 faded crimson bags, 4 posh coral bags.
pale olive bags contain 1 muted blue bag.
drab teal bags contain 2 vibrant lime bags, 3 light turquoise bags, 5 bright lavender bags.
striped fuchsia bags contain 3 bright teal bags, 5 dim bronze bags, 3 faded cyan bags.
dark red bags contain 3 vibrant gold bags, 5 faded bronze bags.
posh cyan bags contain 2 light tan bags.
light salmon bags contain 2 plaid beige bags, 2 dull chartreuse bags, 1 faded beige bag.
clear indigo bags contain 4 plaid olive bags, 1 pale brown bag, 3 shiny fuchsia bags, 4 dotted tomato bags.
shiny olive bags contain 5 dotted lavender bags, 5 bright maroon bags, 5 faded maroon bags.
muted blue bags contain 1 dull violet bag.
bright red bags contain 2 dull bronze bags, 3 pale lime bags, 1 vibrant brown bag, 5 muted magenta bags.
pale violet bags contain 4 pale plum bags.
muted bronze bags contain 2 mirrored gold bags, 4 plaid crimson bags, 4 light cyan bags.
dim gray bags contain 4 dim tomato bags, 5 wavy magenta bags.
shiny crimson bags contain 5 muted brown bags.
dim indigo bags contain 3 striped beige bags, 3 clear gold bags, 2 bright gray bags.
dotted turquoise bags contain 2 striped red bags.
striped tan bags contain 3 light yellow bags.
muted brown bags contain 3 posh black bags, 3 striped brown bags, 5 light gray bags, 2 clear white bags.
clear blue bags contain 2 plaid gold bags, 5 mirrored white bags.
wavy purple bags contain 1 wavy magenta bag, 1 muted aqua bag, 3 dim gray bags, 1 dim tomato bag.
striped magenta bags contain 2 pale fuchsia bags, 4 light cyan bags, 2 shiny fuchsia bags.
dotted teal bags contain 1 mirrored blue bag, 1 posh plum bag, 2 dull violet bags, 4 dotted brown bags.
drab lavender bags contain 5 pale yellow bags, 1 clear silver bag.
dull beige bags contain 4 clear chartreuse bags, 4 drab gray bags.
faded indigo bags contain 1 pale cyan bag.
plaid chartreuse bags contain 4 muted aqua bags, 3 dim coral bags, 3 pale gold bags.
dull fuchsia bags contain 5 pale maroon bags, 2 mirrored bronze bags.
drab white bags contain 4 dull orange bags.
dark maroon bags contain 5 dim lavender bags.
pale black bags contain 2 wavy silver bags.
pale bronze bags contain 4 dim salmon bags, 5 vibrant lavender bags, 4 vibrant crimson bags, 1 bright crimson bag.
mirrored cyan bags contain 3 pale lavender bags, 5 dull silver bags.
dotted green bags contain 1 bright yellow bag, 5 drab fuchsia bags, 5 posh orange bags, 5 mirrored blue bags.
plaid green bags contain 1 wavy tan bag, 2 clear chartreuse bags.
drab beige bags contain 3 dotted lime bags, 4 clear brown bags, 2 dotted salmon bags.
light turquoise bags contain 3 dotted tomato bags, 1 muted silver bag, 4 striped brown bags.
light crimson bags contain 2 dark aqua bags, 4 bright violet bags, 1 mirrored olive bag, 4 mirrored violet bags.
wavy maroon bags contain 2 dull teal bags, 2 pale violet bags, 5 bright aqua bags, 2 faded tan bags.
dark coral bags contain 5 striped black bags.
faded orange bags contain 3 clear silver bags, 2 vibrant tomato bags.
dotted olive bags contain 5 clear gray bags, 5 striped indigo bags, 5 dim gray bags, 5 posh plum bags.
shiny salmon bags contain 2 wavy fuchsia bags, 4 striped gold bags, 5 wavy coral bags.
wavy red bags contain 1 clear silver bag, 5 dotted beige bags, 1 pale cyan bag, 4 dim beige bags.
light gray bags contain 3 dim coral bags, 5 striped indigo bags, 2 bright lime bags, 4 vibrant magenta bags.
muted chartreuse bags contain 2 dim tomato bags, 5 dim coral bags, 3 pale yellow bags, 5 drab gray bags.
pale turquoise bags contain 2 light gray bags, 3 faded salmon bags, 4 drab white bags, 3 plaid olive bags.
striped turquoise bags contain 3 pale plum bags.
drab cyan bags contain 3 wavy indigo bags, 3 clear white bags.
dark magenta bags contain 3 muted blue bags.
faded gray bags contain 1 muted green bag, 5 posh coral bags, 3 wavy magenta bags, 4 light beige bags.
posh crimson bags contain 1 faded lavender bag.
faded green bags contain 4 mirrored red bags, 5 plaid beige bags, 2 shiny maroon bags, 3 mirrored lime bags.
mirrored silver bags contain 2 wavy gold bags, 1 clear beige bag.
shiny aqua bags contain 1 bright teal bag, 4 wavy tan bags.
plaid lime bags contain 2 striped indigo bags.
clear beige bags contain 5 dim tomato bags, 2 plaid olive bags, 2 dark crimson bags, 5 dull turquoise bags.
striped beige bags contain 2 bright white bags, 1 pale cyan bag, 3 dark bronze bags, 3 vibrant gray bags.
dark indigo bags contain 2 striped plum bags.
wavy coral bags contain 4 posh cyan bags, 3 muted fuchsia bags.
plaid gray bags contain 2 clear maroon bags, 3 wavy beige bags, 3 light lime bags.
dim yellow bags contain 2 dotted olive bags, 5 wavy magenta bags, 2 mirrored tomato bags.
plaid fuchsia bags contain 3 dotted white bags, 1 dull purple bag.
bright violet bags contain 1 shiny lavender bag, 3 dotted tomato bags, 4 dotted white bags, 3 mirrored olive bags.
light cyan bags contain 2 posh black bags.
shiny orange bags contain 2 dull purple bags, 1 dotted maroon bag, 2 dull indigo bags, 4 drab gold bags.
pale purple bags contain 1 dotted magenta bag, 3 drab red bags, 1 posh lime bag, 4 muted turquoise bags.
dim brown bags contain 3 dull coral bags, 1 dark tan bag, 1 pale red bag, 3 clear chartreuse bags.
shiny maroon bags contain 3 mirrored indigo bags.
pale tomato bags contain 2 drab gray bags, 3 shiny lavender bags, 4 clear silver bags.
vibrant magenta bags contain no other bags.
plaid indigo bags contain 4 dotted black bags, 1 vibrant aqua bag.
striped chartreuse bags contain 2 pale orange bags, 5 pale maroon bags, 2 dim lime bags.
dim coral bags contain no other bags.
mirrored yellow bags contain 4 dotted tan bags, 1 dull blue bag.
clear lime bags contain 4 striped violet bags, 3 striped chartreuse bags, 5 drab crimson bags.
bright salmon bags contain 2 shiny plum bags, 5 faded white bags.
light green bags contain 5 mirrored bronze bags, 4 dull chartreuse bags.
vibrant beige bags contain 4 striped brown bags, 4 muted blue bags, 5 shiny crimson bags.
plaid tan bags contain 3 pale blue bags, 5 light gray bags, 3 posh tomato bags.
dull aqua bags contain 4 muted blue bags.
wavy green bags contain 4 drab orange bags, 2 vibrant yellow bags, 5 faded beige bags, 3 dotted turquoise bags.
muted yellow bags contain 5 pale magenta bags, 5 striped plum bags.
mirrored tomato bags contain 3 pale salmon bags, 4 shiny lavender bags, 1 dark bronze bag, 2 pale blue bags.
drab fuchsia bags contain 5 mirrored purple bags.
drab olive bags contain 3 wavy violet bags, 3 light tan bags, 4 pale brown bags.
faded brown bags contain 2 light crimson bags.
vibrant white bags contain 2 pale tomato bags, 4 dotted turquoise bags, 3 pale blue bags.
dotted yellow bags contain 3 clear chartreuse bags, 5 drab cyan bags, 5 striped magenta bags.
posh coral bags contain 4 light tan bags, 4 pale brown bags.
drab gold bags contain 2 light tan bags, 4 clear white bags.
mirrored purple bags contain 3 shiny gold bags.
posh green bags contain 4 wavy indigo bags, 1 dark crimson bag, 1 muted brown bag, 1 light gray bag.
bright maroon bags contain 5 dotted silver bags.
dim chartreuse bags contain 4 faded olive bags.
bright coral bags contain 2 bright olive bags, 2 light silver bags.
striped gold bags contain 1 dotted maroon bag, 4 posh maroon bags, 1 pale gold bag.
light chartreuse bags contain 3 plaid blue bags, 4 shiny gold bags, 4 dull teal bags.
clear salmon bags contain 5 plaid blue bags, 3 muted cyan bags, 1 mirrored tomato bag.
wavy blue bags contain 2 drab turquoise bags, 5 vibrant purple bags, 3 faded indigo bags, 2 bright green bags.
dark beige bags contain 4 faded crimson bags, 3 dim silver bags, 4 plaid green bags.
bright gold bags contain 1 striped indigo bag, 2 dark salmon bags.
posh bronze bags contain 3 dim gray bags.
mirrored lavender bags contain 4 striped maroon bags, 5 light blue bags, 2 wavy coral bags, 4 faded crimson bags.
pale tan bags contain 3 vibrant beige bags, 1 dark crimson bag, 1 drab brown bag, 1 bright olive bag.
mirrored coral bags contain 1 clear white bag, 5 dotted beige bags, 2 dull violet bags.
striped white bags contain 3 vibrant gold bags, 1 vibrant crimson bag, 5 muted indigo bags, 4 clear gold bags.
plaid white bags contain 3 light gray bags, 5 drab turquoise bags, 5 dark lavender bags.
clear brown bags contain 1 striped indigo bag, 1 muted cyan bag, 3 striped tomato bags, 2 bright cyan bags.
pale beige bags contain 2 bright fuchsia bags, 2 dotted fuchsia bags, 3 mirrored black bags, 3 dull gold bags.
shiny lavender bags contain 5 clear white bags, 3 striped brown bags.
posh salmon bags contain 4 mirrored plum bags, 1 dotted purple bag, 1 striped gray bag, 1 bright green bag.
posh magenta bags contain 4 dark gray bags, 3 shiny fuchsia bags, 5 dotted tomato bags, 2 posh yellow bags.
striped yellow bags contain 2 faded white bags, 1 dotted lavender bag, 2 posh coral bags, 1 light yellow bag.
bright tomato bags contain 4 shiny plum bags, 4 dotted olive bags, 4 clear purple bags, 2 dotted plum bags.
mirrored turquoise bags contain 2 wavy beige bags, 2 dim gray bags, 5 dark indigo bags.
vibrant lavender bags contain 3 pale magenta bags, 2 shiny coral bags, 4 drab white bags, 5 vibrant white bags.
faded magenta bags contain 1 plaid lavender bag, 2 drab teal bags, 5 dull beige bags.
dark yellow bags contain 1 mirrored gold bag, 2 dark lavender bags, 3 striped indigo bags.
posh silver bags contain 1 dull purple bag, 2 plaid olive bags, 3 striped red bags.
dull green bags contain 4 striped crimson bags, 5 dim coral bags, 3 vibrant aqua bags.
dotted black bags contain 4 posh plum bags, 1 muted blue bag, 4 shiny beige bags, 1 dotted lime bag.
light yellow bags contain 5 muted tomato bags, 3 muted fuchsia bags, 5 posh maroon bags.
wavy black bags contain 3 bright white bags, 2 bright lavender bags.
muted crimson bags contain 1 dark crimson bag, 4 pale salmon bags, 4 striped red bags, 2 dim tomato bags.
shiny yellow bags contain 5 posh salmon bags, 3 dotted olive bags.
striped olive bags contain 1 light black bag, 1 mirrored olive bag, 1 dull purple bag, 2 light orange bags.
light silver bags contain 4 clear silver bags, 4 mirrored black bags, 2 clear gray bags.
dull indigo bags contain 2 muted lime bags.
muted indigo bags contain 4 posh lime bags, 4 dull white bags.
posh red bags contain 2 posh cyan bags, 2 dull brown bags, 5 drab maroon bags.
plaid brown bags contain 3 clear silver bags, 5 dim beige bags, 3 dim lime bags, 4 striped blue bags.
pale green bags contain 2 shiny bronze bags, 3 mirrored plum bags, 4 light yellow bags.
plaid maroon bags contain 5 plaid cyan bags, 1 drab white bag.
dim teal bags contain 4 posh maroon bags, 1 dull gold bag, 4 muted coral bags.
clear lavender bags contain 5 striped brown bags, 3 posh plum bags.
bright yellow bags contain 5 clear tan bags, 2 striped salmon bags.
clear fuchsia bags contain 3 clear coral bags, 4 muted aqua bags.
muted maroon bags contain 3 dotted fuchsia bags.
dark plum bags contain 3 dotted tomato bags, 5 clear violet bags, 3 vibrant magenta bags.
bright magenta bags contain 2 plaid tan bags, 4 dotted purple bags, 3 wavy indigo bags.
dull plum bags contain 3 muted crimson bags, 4 mirrored green bags.
dull black bags contain 3 muted chartreuse bags, 1 posh cyan bag, 4 bright gray bags.
posh orange bags contain 5 striped violet bags.
vibrant teal bags contain 3 bright red bags, 1 wavy indigo bag, 3 pale brown bags.
pale gold bags contain no other bags.
faded plum bags contain 2 striped plum bags, 3 wavy maroon bags, 5 vibrant bronze bags, 4 clear green bags.
shiny coral bags contain 5 dull white bags, 1 clear tan bag, 3 shiny beige bags.
bright lavender bags contain 2 bright lime bags.
shiny indigo bags contain 4 dull coral bags, 5 posh coral bags.
muted turquoise bags contain 5 drab crimson bags, 4 drab teal bags, 3 vibrant bronze bags.
pale plum bags contain 2 dull beige bags, 3 dotted turquoise bags.
dull gray bags contain 3 bright salmon bags.
vibrant indigo bags contain 2 mirrored bronze bags, 3 light orange bags.
light lime bags contain 4 drab coral bags.
pale magenta bags contain 3 dark crimson bags.
clear aqua bags contain 2 plaid olive bags, 4 muted indigo bags.
light gold bags contain 4 vibrant white bags, 5 faded lime bags, 3 striped brown bags, 5 dim coral bags.
dull crimson bags contain 3 dim olive bags, 4 dim turquoise bags, 1 muted fuchsia bag.
clear gray bags contain 3 clear white bags, 4 dark crimson bags, 4 dotted plum bags, 3 light gray bags.
dotted tomato bags contain 5 mirrored blue bags, 3 dotted crimson bags.
bright indigo bags contain 3 wavy lime bags, 5 dark bronze bags, 4 shiny brown bags.
light lavender bags contain 1 dim fuchsia bag.
clear purple bags contain 4 dark red bags, 3 clear turquoise bags.
dark lavender bags contain 5 vibrant crimson bags, 1 vibrant white bag, 3 dull purple bags, 1 plaid tan bag.
vibrant green bags contain 2 wavy teal bags, 2 dull orange bags, 5 plaid coral bags, 2 striped yellow bags.
faded maroon bags contain 1 muted tomato bag, 3 pale gold bags, 2 muted fuchsia bags.
light tomato bags contain 3 shiny fuchsia bags, 4 dull turquoise bags.
light olive bags contain 4 dotted indigo bags, 3 pale coral bags.
faded blue bags contain 2 light gray bags, 3 muted brown bags, 5 dim coral bags, 1 light tan bag.
mirrored white bags contain 1 posh cyan bag.
dull bronze bags contain 5 clear lavender bags, 4 bright olive bags, 4 dull brown bags, 2 striped black bags.
vibrant coral bags contain 2 dim coral bags, 2 faded blue bags, 2 drab cyan bags.
bright lime bags contain no other bags.
wavy crimson bags contain 1 dim indigo bag.
vibrant blue bags contain 2 posh gold bags, 3 mirrored tan bags, 3 muted green bags, 5 faded beige bags.
light orange bags contain 5 posh black bags, 2 dull brown bags.
striped indigo bags contain no other bags.
faded lime bags contain 2 dull violet bags, 2 shiny lavender bags.
dim bronze bags contain 4 mirrored blue bags.
pale coral bags contain 2 clear magenta bags, 4 clear gold bags.
wavy fuchsia bags contain 3 muted olive bags, 1 dull violet bag.
mirrored indigo bags contain 1 clear magenta bag, 3 mirrored beige bags, 3 bright violet bags.
plaid turquoise bags contain 2 muted turquoise bags.
dull blue bags contain 2 dotted white bags, 5 mirrored green bags.
posh white bags contain 2 pale teal bags, 4 pale green bags, 5 dim bronze bags, 5 mirrored cyan bags.
mirrored teal bags contain 2 plaid blue bags, 1 drab crimson bag.
clear silver bags contain 5 striped indigo bags, 2 dim plum bags, 5 muted aqua bags, 5 light tan bags.
dull lime bags contain 2 plaid crimson bags, 5 light cyan bags, 1 dotted crimson bag.
dull yellow bags contain 3 plaid aqua bags, 2 dim red bags.
mirrored olive bags contain 4 faded blue bags, 2 posh purple bags, 1 striped brown bag.
vibrant fuchsia bags contain 2 light black bags, 2 vibrant salmon bags.
mirrored black bags contain 4 posh cyan bags, 1 wavy indigo bag.
pale yellow bags contain 2 faded blue bags, 5 muted fuchsia bags, 2 striped brown bags.
pale fuchsia bags contain 1 drab silver bag, 2 clear silver bags, 2 shiny lavender bags.
drab turquoise bags contain 5 drab cyan bags, 5 plaid cyan bags, 3 wavy tan bags.
vibrant red bags contain 4 mirrored beige bags, 2 wavy magenta bags, 1 light cyan bag.
striped red bags contain no other bags.
vibrant brown bags contain 1 dotted tomato bag, 3 vibrant magenta bags, 2 striped beige bags, 4 dull brown bags.
faded chartreuse bags contain 4 light gray bags, 5 striped salmon bags, 5 dark salmon bags, 3 dull orange bags.
mirrored tan bags contain 4 clear chartreuse bags.
light tan bags contain no other bags.
dim blue bags contain 2 dull white bags.
posh tomato bags contain 3 dull indigo bags, 2 striped red bags.
bright blue bags contain 3 shiny crimson bags, 4 muted brown bags, 3 dotted magenta bags, 2 pale salmon bags.
faded gold bags contain 3 clear white bags, 2 dotted turquoise bags, 5 light orange bags.
plaid orange bags contain 1 clear black bag, 3 striped red bags, 4 dark turquoise bags, 4 dull coral bags.
shiny tan bags contain 3 dotted coral bags, 3 posh orange bags, 5 vibrant tan bags.
clear plum bags contain 5 dim beige bags, 1 pale gray bag, 1 clear purple bag, 5 posh coral bags.
bright turquoise bags contain 2 plaid orange bags.
dotted plum bags contain 5 faded olive bags, 5 clear white bags.
shiny green bags contain 4 drab maroon bags, 2 drab purple bags.
plaid tomato bags contain 1 vibrant tomato bag, 2 posh coral bags, 3 faded beige bags, 2 faded chartreuse bags.
wavy lime bags contain 4 striped olive bags, 1 vibrant beige bag.
striped brown bags contain 4 drab gray bags, 2 clear white bags, 3 bright lime bags, 3 vibrant magenta bags.
dark orange bags contain 1 wavy silver bag, 5 muted magenta bags, 1 dim yellow bag, 1 vibrant purple bag.
dotted magenta bags contain 1 mirrored purple bag.
bright black bags contain 5 shiny aqua bags.
clear green bags contain 4 vibrant gold bags, 4 pale gold bags.
drab indigo bags contain 1 bright coral bag, 5 plaid tomato bags, 3 muted chartreuse bags.
shiny fuchsia bags contain 5 dim lavender bags, 2 light teal bags, 4 dim lime bags, 3 wavy purple bags.
vibrant crimson bags contain 1 dim lavender bag, 5 dark tan bags, 1 dotted turquoise bag, 2 striped red bags.
clear red bags contain 5 wavy magenta bags, 2 bright plum bags.
dotted red bags contain 3 pale cyan bags.
striped black bags contain 3 pale red bags, 1 clear beige bag, 3 dull coral bags.
plaid crimson bags contain 4 wavy violet bags, 1 clear gray bag.
muted silver bags contain 1 muted chartreuse bag, 2 shiny bronze bags, 1 striped brown bag, 1 posh coral bag.
drab green bags contain 1 faded white bag, 5 posh orange bags, 2 dim magenta bags, 3 wavy purple bags.
vibrant olive bags contain 5 dark yellow bags, 1 pale black bag, 1 drab olive bag, 5 shiny gold bags.
bright cyan bags contain 2 dim tomato bags, 2 plaid brown bags, 1 bright plum bag, 5 drab lavender bags.
dotted blue bags contain 2 pale tan bags, 1 striped green bag, 2 striped lime bags, 3 shiny tomato bags.
faded yellow bags contain 3 posh maroon bags, 1 dull tomato bag, 2 pale cyan bags.
dark black bags contain 3 shiny purple bags, 2 clear violet bags, 5 wavy brown bags.
vibrant bronze bags contain 5 pale salmon bags.
wavy chartreuse bags contain 1 posh turquoise bag, 1 vibrant silver bag, 3 plaid teal bags, 1 dotted salmon bag.
faded black bags contain 1 light tan bag, 1 faded beige bag.
dim beige bags contain 3 muted fuchsia bags, 5 striped plum bags, 1 faded violet bag, 5 clear chartreuse bags.
striped plum bags contain 1 posh black bag, 2 plaid lime bags, 4 clear white bags.
dotted silver bags contain 2 vibrant gray bags, 5 clear white bags, 2 vibrant tomato bags.
dull salmon bags contain 4 pale plum bags, 2 pale magenta bags, 1 light gray bag.
pale maroon bags contain 3 vibrant white bags.
light blue bags contain 3 mirrored maroon bags.
striped aqua bags contain 5 dark purple bags, 1 striped green bag, 4 mirrored coral bags.
mirrored beige bags contain 1 shiny fuchsia bag, 1 dim plum bag.
pale aqua bags contain 5 mirrored green bags.
dim red bags contain 2 mirrored maroon bags, 4 dotted yellow bags, 5 dim tomato bags, 4 faded silver bags.
light bronze bags contain 1 dim orange bag, 1 posh tomato bag, 5 mirrored white bags.
plaid coral bags contain 5 vibrant tomato bags, 5 pale bronze bags, 3 dotted turquoise bags, 2 drab brown bags.
dull violet bags contain 2 muted chartreuse bags.
wavy teal bags contain 3 shiny plum bags, 5 dark lavender bags.
wavy cyan bags contain 5 faded red bags, 4 light bronze bags, 5 shiny bronze bags, 4 dull silver bags.
faded olive bags contain 4 wavy magenta bags, 1 striped red bag.
drab tomato bags contain 5 plaid cyan bags, 1 plaid chartreuse bag, 1 dim tomato bag.
clear chartreuse bags contain 4 striped brown bags, 2 plaid lime bags.
dull olive bags contain 1 dull purple bag, 2 plaid yellow bags.
dim silver bags contain 3 pale tomato bags, 1 plaid chartreuse bag.
dotted coral bags contain 5 pale salmon bags, 4 dim coral bags, 4 striped fuchsia bags, 2 dim turquoise bags.
bright fuchsia bags contain 4 light gold bags, 3 shiny crimson bags, 3 clear white bags.
bright brown bags contain 1 vibrant tomato bag, 2 wavy teal bags, 3 dotted red bags.
striped cyan bags contain 3 bright lime bags.
clear turquoise bags contain 5 mirrored maroon bags.
posh brown bags contain 5 vibrant silver bags, 4 bright lime bags.
wavy aqua bags contain 4 wavy indigo bags, 1 faded crimson bag, 4 drab indigo bags.
pale chartreuse bags contain 2 faded salmon bags.
clear gold bags contain 2 faded turquoise bags, 1 shiny magenta bag.
muted beige bags contain 5 mirrored indigo bags, 1 clear violet bag.
light white bags contain 1 vibrant magenta bag.
muted cyan bags contain 2 plaid white bags, 5 mirrored black bags, 4 pale gold bags, 5 drab magenta bags.
muted teal bags contain 1 pale orange bag.
vibrant cyan bags contain 2 dotted magenta bags, 1 clear tan bag.
wavy white bags contain 1 faded blue bag.
striped silver bags contain 5 light crimson bags, 4 clear salmon bags, 1 shiny green bag.
shiny teal bags contain 1 wavy coral bag.
dim black bags contain 3 vibrant silver bags, 1 clear maroon bag, 4 bright chartreuse bags.
dim plum bags contain 2 posh coral bags, 3 dark crimson bags, 1 drab olive bag.
wavy bronze bags contain 2 faded olive bags, 2 dim red bags, 2 pale brown bags.
dim turquoise bags contain 3 dull teal bags, 5 shiny bronze bags, 2 striped orange bags, 1 dim fuchsia bag.
posh lime bags contain 4 muted tomato bags, 3 muted brown bags, 1 bright olive bag.
shiny cyan bags contain 3 faded purple bags, 5 wavy chartreuse bags, 4 shiny maroon bags.
pale blue bags contain 2 striped turquoise bags, 2 dull turquoise bags.
muted black bags contain 4 pale turquoise bags, 4 pale beige bags, 4 mirrored black bags.
posh gold bags contain 1 light brown bag, 4 posh yellow bags, 5 dim violet bags.
plaid olive bags contain no other bags.
dotted beige bags contain 4 clear tan bags, 1 shiny fuchsia bag, 3 posh green bags, 4 wavy purple bags.
dull magenta bags contain 3 muted lime bags, 5 mirrored blue bags.
striped green bags contain 5 light cyan bags.
dark white bags contain 2 wavy yellow bags, 5 dim salmon bags, 2 bright green bags.
muted lavender bags contain 3 dotted teal bags, 5 dotted bronze bags, 2 mirrored lime bags, 5 dim fuchsia bags.
dotted indigo bags contain 5 drab chartreuse bags, 1 dim lime bag, 3 plaid white bags, 2 shiny plum bags.
light indigo bags contain 5 bright tan bags.
faded turquoise bags contain 3 faded cyan bags, 4 dull salmon bags, 3 dark bronze bags.
mirrored magenta bags contain 1 clear turquoise bag, 4 wavy plum bags.
dull brown bags contain 5 dim tomato bags.
plaid aqua bags contain 4 bright teal bags, 3 dim gray bags, 3 clear crimson bags, 5 clear chartreuse bags.
drab red bags contain 2 plaid purple bags, 3 muted silver bags.
wavy plum bags contain 3 wavy indigo bags, 3 posh cyan bags.
bright aqua bags contain 1 dim magenta bag.
dotted violet bags contain 4 light orange bags.
wavy salmon bags contain 3 wavy turquoise bags, 1 dark lavender bag, 3 striped silver bags, 3 posh coral bags.
posh beige bags contain 1 pale black bag.
clear bronze bags contain 4 clear teal bags, 3 dim crimson bags.
pale teal bags contain 1 dark bronze bag, 4 plaid maroon bags, 4 light magenta bags.
mirrored violet bags contain 2 clear beige bags.
drab blue bags contain 1 faded yellow bag.
light violet bags contain 4 plaid aqua bags.
vibrant chartreuse bags contain 1 mirrored beige bag.
pale salmon bags contain 5 drab gray bags, 3 muted brown bags, 2 dotted plum bags.
plaid violet bags contain 5 muted blue bags, 4 wavy black bags.
bright tan bags contain 1 bright white bag, 4 posh cyan bags.
vibrant purple bags contain 2 dark plum bags, 4 bright brown bags.
drab tan bags contain 5 dull orange bags, 4 plaid fuchsia bags.
dotted tan bags contain 2 drab violet bags, 1 light turquoise bag, 2 clear indigo bags.
vibrant maroon bags contain 1 drab silver bag, 1 plaid plum bag.
dull white bags contain 2 dotted crimson bags, 1 light orange bag, 2 dark lavender bags, 5 plaid blue bags.
wavy orange bags contain 1 shiny fuchsia bag, 2 clear lavender bags.
faded fuchsia bags contain 2 dim purple bags, 4 muted yellow bags, 3 muted brown bags.
dim tan bags contain 1 shiny purple bag, 5 wavy magenta bags, 4 faded beige bags, 2 vibrant lime bags.
bright white bags contain 1 dim plum bag, 1 light gray bag, 2 muted fuchsia bags.
pale lavender bags contain 2 faded lime bags, 1 faded tan bag, 3 dotted maroon bags.
dim fuchsia bags contain 2 clear lavender bags, 5 dotted red bags, 3 vibrant chartreuse bags.
pale silver bags contain 5 posh black bags.
faded salmon bags contain 4 light white bags, 2 plaid brown bags, 3 vibrant yellow bags.
faded bronze bags contain 5 mirrored white bags, 5 striped plum bags, 4 dim magenta bags, 2 faded lime bags.
shiny gray bags contain 1 striped salmon bag, 3 clear crimson bags.
drab lime bags contain 5 light crimson bags.
bright orange bags contain 4 plaid tomato bags, 1 mirrored bronze bag.
dark crimson bags contain 5 striped red bags.
dull teal bags contain 4 wavy indigo bags, 1 drab brown bag, 3 light cyan bags, 4 dotted gold bags.
light maroon bags contain 2 bright violet bags, 2 dim gray bags, 3 shiny turquoise bags.
faded coral bags contain 4 dark teal bags.
shiny bronze bags contain 3 pale salmon bags, 3 pale plum bags.
dim violet bags contain 3 vibrant magenta bags, 4 shiny bronze bags.
pale red bags contain 5 drab silver bags.
dark tomato bags contain 4 shiny lime bags, 5 wavy purple bags, 4 shiny blue bags, 5 drab gold bags.
dull gold bags contain 5 light olive bags, 1 light gray bag.
posh tan bags contain 4 dull gold bags, 3 vibrant turquoise bags, 2 plaid aqua bags, 5 dim indigo bags.
bright gray bags contain 5 pale yellow bags.
plaid salmon bags contain 3 shiny indigo bags.
dotted bronze bags contain 5 mirrored black bags, 3 muted indigo bags, 3 faded yellow bags, 3 bright teal bags.
mirrored crimson bags contain 2 pale salmon bags, 1 plaid maroon bag.
wavy brown bags contain 1 drab turquoise bag, 3 posh yellow bags.
muted coral bags contain 4 clear blue bags, 5 dark cyan bags.
wavy yellow bags contain 2 drab brown bags, 2 striped olive bags, 1 wavy white bag.
muted aqua bags contain 2 light tan bags, 2 pale yellow bags, 5 plaid lime bags.
drab crimson bags contain 5 plaid cyan bags, 3 dim plum bags.
vibrant yellow bags contain 2 faded maroon bags, 4 mirrored olive bags, 2 plaid red bags.
faded silver bags contain 4 dim lime bags, 4 dark tomato bags, 5 muted magenta bags, 1 dotted red bag.
drab violet bags contain 2 vibrant aqua bags.
faded teal bags contain 2 light gold bags, 5 striped turquoise bags, 2 dim salmon bags, 2 posh tomato bags.
wavy magenta bags contain 4 faded blue bags, 1 muted brown bag, 3 pale brown bags.
vibrant salmon bags contain 2 posh turquoise bags, 1 dark crimson bag.
bright olive bags contain 4 light teal bags, 2 vibrant lime bags, 3 dull salmon bags, 2 dull tomato bags.
plaid teal bags contain 5 striped teal bags.
dark cyan bags contain 3 dull brown bags, 4 posh violet bags.
muted olive bags contain 1 faded blue bag, 5 dotted brown bags.
dark violet bags contain 3 mirrored beige bags.
drab orange bags contain 4 faded aqua bags, 1 striped red bag, 5 mirrored maroon bags.
wavy gray bags contain 4 mirrored green bags.
faded white bags contain 3 dim lavender bags, 3 clear silver bags.
faded lavender bags contain 2 posh violet bags, 4 striped violet bags, 2 clear silver bags, 2 faded cyan bags.
light red bags contain 2 bright white bags, 1 dull gray bag, 3 bright lavender bags.
bright beige bags contain 3 mirrored silver bags.
shiny magenta bags contain 1 light silver bag.
striped teal bags contain 1 plaid lime bag, 2 clear tomato bags, 1 clear chartreuse bag.
dim olive bags contain 5 pale white bags, 5 wavy black bags, 4 faded magenta bags, 4 dark red bags.
dull tan bags contain 3 dark lavender bags, 5 faded violet bags.
striped purple bags contain 5 wavy violet bags, 5 light gold bags.
dim crimson bags contain 5 striped magenta bags.
faded beige bags contain 2 striped brown bags, 3 dark salmon bags.
light purple bags contain 2 bright lavender bags, 5 vibrant lime bags, 3 striped blue bags.
mirrored blue bags contain 2 clear white bags, 2 drab cyan bags, 5 light cyan bags.
dull silver bags contain 1 shiny bronze bag, 1 dotted beige bag.
pale crimson bags contain 2 shiny turquoise bags.
wavy indigo bags contain 5 clear white bags, 5 plaid cyan bags, 1 muted brown bag, 1 pale yellow bag.
bright chartreuse bags contain 3 posh crimson bags, 5 shiny maroon bags.
vibrant silver bags contain 3 striped aqua bags, 5 striped gold bags, 2 dim lime bags, 4 clear chartreuse bags.
dark purple bags contain 4 plaid lavender bags, 3 clear chartreuse bags, 4 striped teal bags.
vibrant turquoise bags contain 1 light gold bag, 1 light turquoise bag, 4 muted indigo bags, 2 wavy magenta bags.
vibrant tan bags contain 1 dull purple bag, 5 vibrant beige bags.
dim salmon bags contain 1 striped violet bag, 5 light teal bags, 5 light tan bags, 5 striped brown bags.
muted violet bags contain 5 bright brown bags, 5 faded aqua bags, 3 clear purple bags, 4 plaid lavender bags.
mirrored gray bags contain 4 drab maroon bags, 3 posh violet bags.
striped blue bags contain 2 plaid cyan bags, 5 pale gold bags.
vibrant gray bags contain 4 pale magenta bags, 4 vibrant bronze bags, 3 drab silver bags, 4 posh tomato bags.
faded tan bags contain 4 plaid olive bags.
muted green bags contain 2 posh cyan bags, 1 plaid lime bag, 5 muted crimson bags.
shiny tomato bags contain 3 wavy violet bags, 4 posh coral bags, 3 striped red bags.
muted plum bags contain 2 plaid salmon bags.
pale indigo bags contain 3 pale cyan bags, 5 vibrant lime bags, 5 vibrant tomato bags.
mirrored fuchsia bags contain 4 posh gray bags, 3 muted tan bags, 4 dim blue bags.
dark lime bags contain 3 clear black bags, 3 dark tomato bags, 2 mirrored black bags.
muted white bags contain 3 shiny black bags, 5 dark purple bags, 3 vibrant silver bags.
striped gray bags contain 5 dark salmon bags.
dotted fuchsia bags contain 1 mirrored red bag, 3 dotted lavender bags.
posh maroon bags contain 1 mirrored beige bag.
vibrant plum bags contain 3 clear red bags.
posh turquoise bags contain 2 shiny magenta bags.
light black bags contain 4 light orange bags, 1 dark salmon bag, 4 striped plum bags.
clear yellow bags contain 1 posh aqua bag.
dim purple bags contain 2 striped green bags.
muted tan bags contain 4 mirrored gray bags, 1 dotted violet bag.
drab silver bags contain 5 clear chartreuse bags, 1 drab olive bag, 2 posh coral bags, 5 bright lime bags.
plaid bronze bags contain 3 wavy black bags, 4 wavy orange bags, 3 dim tomato bags, 3 muted teal bags.
dark green bags contain 5 dull red bags, 3 bright crimson bags, 5 shiny salmon bags, 1 muted purple bag.
bright silver bags contain 1 striped cyan bag.
striped lime bags contain 2 dim magenta bags, 5 faded chartreuse bags, 2 clear indigo bags.
dotted gold bags contain 2 light cyan bags.
drab black bags contain 5 faded red bags, 5 plaid orange bags.
dim magenta bags contain 5 dull coral bags.
light plum bags contain 4 light yellow bags, 5 shiny bronze bags, 5 posh purple bags, 5 plaid olive bags.
dotted cyan bags contain 5 light salmon bags, 4 dull tomato bags, 3 clear blue bags.
posh blue bags contain 4 muted brown bags, 2 muted aqua bags.
posh gray bags contain 4 pale green bags, 2 faded chartreuse bags, 2 drab blue bags.
clear tan bags contain 4 clear gray bags.
mirrored salmon bags contain 1 dull tan bag, 4 mirrored plum bags, 5 muted tan bags, 3 plaid blue bags.
light brown bags contain 1 dim chartreuse bag.
dull lavender bags contain 1 drab white bag, 5 dull indigo bags.
striped violet bags contain 5 muted brown bags, 3 plaid cyan bags, 2 light gray bags.
clear crimson bags contain 1 drab teal bag, 5 dark tan bags, 1 pale salmon bag, 4 dull turquoise bags.
dim white bags contain 3 bright olive bags.
dim green bags contain 4 light silver bags, 1 wavy green bag, 1 striped gold bag.
dull maroon bags contain 4 wavy magenta bags.
striped lavender bags contain 5 faded white bags, 4 mirrored tomato bags, 5 mirrored crimson bags.
faded tomato bags contain 4 pale gray bags.
pale cyan bags contain 1 dull beige bag, 4 light white bags, 5 clear tan bags.
wavy tomato bags contain 5 dotted silver bags, 5 faded gray bags, 1 striped teal bag.
dim tomato bags contain 4 bright lime bags, 3 dim lavender bags, 3 muted tomato bags, 4 dark crimson bags.
striped tomato bags contain 3 plaid chartreuse bags, 4 light cyan bags.
plaid gold bags contain 1 dark yellow bag.
dark silver bags contain 2 dull blue bags, 2 bright purple bags, 5 dim tomato bags.
dotted purple bags contain 4 striped blue bags.
dark fuchsia bags contain 2 light cyan bags.
dotted salmon bags contain 3 drab teal bags, 5 dotted teal bags, 4 vibrant white bags.
mirrored gold bags contain 2 striped salmon bags, 5 pale fuchsia bags, 3 dull purple bags.
posh violet bags contain 1 dim salmon bag, 5 clear gold bags, 1 bright salmon bag.
shiny beige bags contain 2 muted brown bags, 4 shiny gold bags, 5 wavy indigo bags.
plaid cyan bags contain 5 muted tomato bags, 4 drab gray bags, 2 dark crimson bags, 1 striped brown bag.
vibrant lime bags contain 5 dull magenta bags.
clear black bags contain 3 wavy lavender bags.
light coral bags contain 2 pale salmon bags, 1 striped brown bag, 5 mirrored plum bags, 1 drab gold bag.
faded aqua bags contain 2 pale blue bags, 4 drab lavender bags.
wavy gold bags contain 1 dotted plum bag.
shiny turquoise bags contain 4 dull gray bags, 2 dim orange bags.
dull purple bags contain 1 shiny gold bag, 3 plaid olive bags.
dull coral bags contain 1 faded tan bag, 4 clear chartreuse bags, 3 shiny crimson bags, 4 plaid lavender bags.
dull red bags contain 5 dotted beige bags, 4 striped tomato bags, 1 shiny yellow bag.
bright bronze bags contain 2 wavy black bags, 5 mirrored bronze bags.
faded violet bags contain 3 pale yellow bags, 5 posh cyan bags, 5 wavy purple bags, 5 vibrant magenta bags.
shiny blue bags contain 1 dotted teal bag, 4 wavy purple bags, 2 striped brown bags, 3 bright lavender bags.
striped salmon bags contain 2 light tan bags, 4 striped red bags, 1 striped indigo bag, 1 pale gold bag.
shiny silver bags contain 4 faded silver bags, 4 clear maroon bags.
faded crimson bags contain 1 faded bronze bag, 5 dull brown bags, 5 posh plum bags, 3 shiny plum bags.
vibrant tomato bags contain 3 plaid cyan bags, 5 drab teal bags, 5 dotted crimson bags, 5 light tan bags.
plaid red bags contain 2 vibrant gray bags, 5 shiny bronze bags, 5 dull black bags, 2 light yellow bags.
muted red bags contain 2 clear indigo bags, 4 dotted lime bags, 3 dim gray bags, 1 mirrored lime bag.
mirrored chartreuse bags contain 2 dull black bags, 1 dark white bag.
dim gold bags contain 3 plaid blue bags, 2 dotted purple bags.
pale white bags contain 3 pale yellow bags, 1 bright tan bag, 4 striped orange bags, 4 light yellow bags.
light magenta bags contain 3 light black bags, 4 muted turquoise bags.
shiny lime bags contain 1 drab cyan bag.
light teal bags contain 3 dim plum bags, 1 posh black bag, 3 dull beige bags.
plaid black bags contain 4 faded silver bags, 2 faded magenta bags.
clear orange bags contain 1 posh orange bag, 4 bright orange bags, 5 clear indigo bags.
clear coral bags contain 3 faded crimson bags, 1 dull silver bag.
muted lime bags contain 2 dim plum bags.
shiny purple bags contain 5 faded aqua bags.
vibrant gold bags contain 5 drab lavender bags, 4 striped red bags.
clear white bags contain no other bags.
posh aqua bags contain 2 light blue bags, 1 posh turquoise bag, 4 faded teal bags, 3 dotted purple bags.
posh black bags contain no other bags.
mirrored maroon bags contain 4 plaid blue bags, 3 dotted maroon bags, 5 striped plum bags.
dotted crimson bags contain 5 striped salmon bags, 1 pale brown bag, 1 posh black bag, 5 bright lime bags.
striped orange bags contain 4 faded olive bags.
posh teal bags contain 2 faded lavender bags, 3 dim indigo bags.
striped bronze bags contain 2 bright lavender bags, 2 plaid olive bags, 3 vibrant brown bags, 5 pale maroon bags.
dull orange bags contain 3 dark crimson bags, 5 pale salmon bags, 4 vibrant gray bags, 4 plaid olive bags.
clear maroon bags contain 2 wavy gray bags, 2 clear blue bags.
clear tomato bags contain 1 drab olive bag, 2 muted brown bags.
dark aqua bags contain 3 striped white bags.
dull chartreuse bags contain 3 faded tan bags, 3 light orange bags, 2 clear chartreuse bags.
dim cyan bags contain 1 shiny green bag, 4 vibrant brown bags, 4 faded yellow bags, 1 striped aqua bag.
pale orange bags contain 3 drab indigo bags, 4 plaid green bags, 2 wavy lavender bags.
dull cyan bags contain 5 mirrored turquoise bags, 3 posh indigo bags, 5 drab tomato bags, 3 bright aqua bags.
drab brown bags contain 2 clear tan bags, 1 faded yellow bag, 4 vibrant coral bags, 3 mirrored blue bags.
plaid blue bags contain 1 light teal bag, 1 faded tan bag.
dotted orange bags contain 5 dull fuchsia bags, 3 muted brown bags.
muted salmon bags contain 2 wavy coral bags.
pale brown bags contain 4 light tan bags, 3 dim coral bags, 2 plaid olive bags, 4 striped brown bags.
wavy tan bags contain 4 mirrored blue bags, 1 posh purple bag.
mirrored plum bags contain 4 plaid tan bags, 3 wavy yellow bags, 4 vibrant magenta bags, 3 pale lavender bags.
bright purple bags contain 4 dark red bags, 5 clear white bags.
shiny chartreuse bags contain 4 posh plum bags.
shiny violet bags contain 4 mirrored indigo bags, 1 faded beige bag.
drab maroon bags contain 5 posh cyan bags.
dim lavender bags contain 2 vibrant magenta bags, 4 posh black bags, 5 bright lime bags, 3 light tan bags.
shiny gold bags contain 2 muted fuchsia bags, 3 clear silver bags.
wavy violet bags contain 2 vibrant magenta bags, 5 striped red bags, 4 plaid lime bags, 2 bright lime bags.
light beige bags contain 3 pale tan bags.
dotted lavender bags contain 5 dim plum bags, 1 dull magenta bag.
clear teal bags contain 2 plaid yellow bags, 4 light blue bags, 4 striped maroon bags, 1 vibrant olive bag.
faded purple bags contain 2 clear olive bags, 4 mirrored teal bags, 2 plaid gold bags.
pale lime bags contain 5 drab yellow bags, 4 bright coral bags.
plaid beige bags contain 2 faded violet bags, 5 plaid tan bags.
wavy lavender bags contain 5 striped brown bags.
dull tomato bags contain 4 faded olive bags.
plaid plum bags contain 4 faded cyan bags, 2 clear olive bags.
dark gray bags contain 2 dark red bags, 3 clear indigo bags, 5 dim tomato bags.
plaid lavender bags contain 5 plaid green bags, 1 shiny tomato bag.
dim aqua bags contain 5 clear silver bags.
dark salmon bags contain 1 drab olive bag, 5 posh coral bags.
vibrant violet bags contain 3 dim plum bags, 3 dim turquoise bags, 3 striped orange bags.
mirrored red bags contain 3 dull gray bags, 5 mirrored violet bags, 3 vibrant coral bags.
mirrored brown bags contain 3 vibrant tomato bags, 1 wavy lavender bag.
mirrored bronze bags contain 1 striped orange bag, 1 drab gray bag.
dotted lime bags contain 5 drab cyan bags, 3 dotted maroon bags, 2 vibrant white bags, 5 plaid crimson bags.
dotted chartreuse bags contain 5 bright maroon bags.
clear violet bags contain 5 striped orange bags, 2 muted lime bags, 4 vibrant bronze bags, 2 drab silver bags.
plaid magenta bags contain 2 bright blue bags, 2 shiny chartreuse bags.
mirrored orange bags contain 1 striped yellow bag, 1 drab gold bag, 5 striped beige bags, 4 pale brown bags.
drab salmon bags contain 5 clear yellow bags, 1 dark beige bag.
drab magenta bags contain 4 dull gray bags, 4 faded tan bags.
dim maroon bags contain 4 striped teal bags, 5 striped black bags, 2 drab indigo bags, 4 vibrant beige bags.
wavy olive bags contain 5 faded chartreuse bags, 2 dotted lavender bags, 3 wavy brown bags, 3 dim turquoise bags.
light aqua bags contain 3 dark violet bags, 3 posh tomato bags.
dark chartreuse bags contain 3 light plum bags, 4 vibrant chartreuse bags, 3 dotted purple bags, 1 light turquoise bag.
shiny red bags contain 4 dotted maroon bags, 3 dull coral bags, 3 dim coral bags.
dark gold bags contain 3 dim chartreuse bags.
dark turquoise bags contain 4 dark olive bags.
plaid yellow bags contain 1 dark salmon bag, 3 drab olive bags, 4 posh fuchsia bags, 3 mirrored teal bags.
muted tomato bags contain 1 vibrant magenta bag, 2 light cyan bags.
dark brown bags contain 4 muted magenta bags, 3 light turquoise bags, 5 dim silver bags.
dark bronze bags contain 2 striped red bags, 4 vibrant coral bags.
posh fuchsia bags contain 2 faded tan bags.
dark teal bags contain 5 dark salmon bags, 1 faded violet bag, 2 drab olive bags, 4 dim plum bags.
drab yellow bags contain 4 plaid tan bags, 1 dull white bag, 3 dull violet bags.
dotted gray bags contain 2 vibrant lavender bags, 1 striped aqua bag, 5 drab violet bags, 1 light red bag.
drab purple bags contain 5 posh orange bags.
striped crimson bags contain 3 striped salmon bags, 1 posh plum bag, 1 pale orange bag, 5 posh indigo bags.
muted orange bags contain 4 muted silver bags, 4 dotted plum bags, 5 shiny blue bags.
muted gray bags contain 2 muted salmon bags, 3 bright bronze bags, 5 bright brown bags.
dull turquoise bags contain 2 plaid olive bags, 5 striped turquoise bags, 5 muted brown bags, 1 vibrant magenta bag.
dotted maroon bags contain 2 dim salmon bags, 5 clear white bags, 4 wavy black bags.
striped coral bags contain 2 shiny violet bags, 5 plaid maroon bags, 3 bright tan bags, 4 mirrored chartreuse bags.
dark tan bags contain 4 faded white bags.
posh plum bags contain 5 pale brown bags, 3 muted brown bags, 4 posh cyan bags, 1 light turquoise bag.
shiny plum bags contain 4 dull turquoise bags, 1 shiny gold bag.
posh indigo bags contain 1 bright brown bag, 2 dull silver bags.
muted fuchsia bags contain 5 plaid olive bags.
drab bronze bags contain 3 drab coral bags, 3 dull chartreuse bags, 2 posh turquoise bags.
shiny white bags contain 5 dark tan bags, 5 shiny magenta bags.
mirrored green bags contain 5 light maroon bags, 1 light gold bag.
mirrored aqua bags contain 1 striped chartreuse bag, 4 faded coral bags, 1 muted silver bag.
vibrant orange bags contain 3 plaid tan bags.
shiny black bags contain 1 mirrored gray bag, 1 posh fuchsia bag, 3 muted salmon bags, 4 dotted crimson bags.
dark blue bags contain 1 shiny tomato bag, 5 posh beige bags.
bright crimson bags contain 1 striped green bag.
posh chartreuse bags contain 3 dim magenta bags, 2 dull orange bags.
pale gray bags contain 1 drab coral bag.
muted gold bags contain 1 muted orange bag, 5 faded beige bags, 1 wavy tomato bag, 5 posh lime bags.
faded red bags contain 3 dark bronze bags.
striped maroon bags contain 1 dark salmon bag, 4 dim coral bags, 1 posh coral bag.
muted magenta bags contain 4 muted teal bags, 5 dotted turquoise bags, 3 pale plum bags, 4 faded bronze bags.
vibrant aqua bags contain 4 faded crimson bags.
bright teal bags contain 4 bright olive bags, 5 mirrored black bags, 4 drab coral bags, 3 dotted beige bags.
dim orange bags contain 2 shiny fuchsia bags, 3 striped magenta bags.
dotted white bags contain 5 mirrored blue bags, 3 shiny tomato bags, 1 dull coral bag.
clear magenta bags contain 3 dark teal bags, 3 vibrant white bags.
light fuchsia bags contain 5 light violet bags, 2 striped aqua bags.'''

remove_digits = str.maketrans('', '', digits)
rules = [rule.translate(remove_digits) for rule in data.split('\n')]
rules = [rule for rule in rules if not rule.endswith("contains no other bags.")]


def clean_up(s):
    return s.replace("bag", '').replace("bags", '').strip().replace('.', '')


can_contain = defaultdict(list)
for rule in rules:
    holding_bag, allowed_contents = map(clean_up, rule.split("s contain"))
    can_contain[holding_bag] = allowed_contents

is_contained_in = defaultdict(dict)
for rule in rules:
    parent, child_list = map(clean_up, rule.split("s contain"))
    for child in [c for c in child_list.split(',') if c.find("no other") == -1]:
        is_contained_in[child] = parent

target_bag = "shiny gold"

containing_bags = [k for (k, v) in can_contain.items() if v.find(target_bag) != -1]

for bag in containing_bags:
    containing_bags.extend([k for (k, v) in can_contain.items() if v.find(bag) != -1])

print("There are {} bags that can contain a {} bag".format(len(set(containing_bags)), target_bag))
