Quest for Ancient Secrets

Whenever a card is put into your graveyard from anywhere, you may put a quest counter on Quest for Ancient Secrets.
Remove five quest counters from Quest for Ancient Secrets and sacrifice it: Target player shuffles their graveyard into their library.