Perfect mining