Отправить по sms: Optimal quantum circuits for general phase estimation