Is there a way to apply a function h to the following nested list

{{a, b}, {c, d}, {{d, e }, {f, g}}}

where this should should become

{h[a], h[c], {h[d], h[f]}}

h is applied to the first element of each (deepest nested) sublist, replacing this sublist. The nesting is never deeper than the example displayed above. I.e. the expression tree for the list has at most depth 3.

The rest of the list structure pattern is preserved.

Here, a, c, d and f are *not* atoms. They are again expressions with heads. The heads are however not list-heads.

As an example, consider

{{u[a], u[b]}, {u[v[c]], d}, {{d, e}, {f, g}}}

applying h to this should yield:

{h[u[a]], h[u[v[c]]], {h[d], h[f]}}

In other words, h is applied to the `leaves" of the list expression given above, where these`

leaves” are more complicated expressions.