Search API filters for this condition: (a || b) &&& (c || d)

I’m trying to use the Search API: /crm/v3/objects/deals/search along with this filter condition: (a || b) && (c || d) - where a, b, c, d are properties that have to be equal to some specific value.

On the documentation page I found this condition: (a && !b) || c

but based on that, it doesn’t seem straight forward to write the required one.

Documentation page: Search the CRM - HubSpot docs

I can rewrite it as (a && c) || (a && d) || (b && c) || (b && d)

but then, it will not be in limits:

You can include a maximum of three filterGroups with up to three filters in each group.