Block A is hanging from a vertical spring and is at rest. Block B strikes block A with velocity v and sticks to it. Then the value of v for which the spring just attains natural length is