When Hancock dies, its undying ability triggers, returning it from your graveyard to the battlefield with a +1/+1 counter on it.
Resolve the Altar of Dementia ability.
Activate Altar of Dementia by sacrificing Hancock
When Hancock dies, its persist ability triggers, returning it from your graveyard to the battlefield with a -1/-1 counter on it.
Hancock enters and dies as a state-based action due to having 0 toughness. Its undying ability triggers, returning it from your graveyard to the battlefield with a +1/+1 counter on it.
Resolve the Altar of Dementia ability from step 4.