General formula for SHE problem solution