import re

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

test2 = """
shiny gold bags contain 2 dark red bags.
dark red bags contain 2 dark orange bags.
dark orange bags contain 2 dark yellow bags.
dark yellow bags contain 2 dark green bags.
dark green bags contain 2 dark blue bags.
dark blue bags contain 2 dark violet bags.
dark violet bags contain no other bags.
"""

bags = bags.split('\n')[1:][:-1]

def remove_the_word_bag(bag_string) :
    splitted = bag_string.split(' ')
    return ' '.join(splitted[:-1])

def part_one() :
    bags_dictionary = {}

    for bag in bags :
        bags_found = list(map(remove_the_word_bag, re.findall('[a-z]+\s[a-z]+\sbags*', bag)))
        quantities = re.findall('[0-9]+', bag)
        first_bag = bags_found[0]
        for i, b in enumerate(bags_found[1:]) :
            try :
                new = [first_bag, int(quantities[i])]
            except :
                pass
            try :
                bags_dictionary[b].append(new)
            except :
                bags_dictionary[b] = [new]
    bag_array = [bag[0] for bag in bags_dictionary['shiny gold']]
    index = 0
    while True :
        try :
            new_additions = bags_dictionary[bag_array[index]]
            for new_addition in new_additions :
                if not (new_addition[0] in bag_array) :
                    bag_array.append(new_addition[0])
        except :
            pass
        index += 1
        if index > len(bag_array) :
            break
    return len(bag_array)

def part_two() :
    bags_dictionary = {}
    for line in bags :
        try :
            key, values = line.split('contain')
            key = ' '.join(key[:-1].split(' ')[:-1])
            values = values[1:][:-1].split(', ')
            value_array = []
            for value in values :
                value_split = value.split(' ')[:-1]
                value_array.append([' '.join(value_split[1:]), int(value_split[0])])
            bags_dictionary[key] = value_array
        except :
            pass
    bag_array = bags_dictionary['shiny gold']
    index = 1
    while True :
        try :
            new_additions = bags_dictionary[bag_array[index][0]]
            for new_addition in new_additions :
                bag_array.append([new_addition[0], new_addition[1]*bag_array[index][1]])
        except :
            pass
        index += 1
        if index > len(bag_array) :
            break
    return sum(map(lambda x: x[1], bag_array))

print(part_two())
