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 his or her graveyard into his or her library.