Let us do all that work for you and just lean back...
Microsoft 365: Public folders are automatically created (Exchange Online)
When public folders (Microsoft 365) are synchronized, the specified path including its subfolders is automatically created. This allows for very easy and fast synchronization without the need to create the required folders in the Exchange Admin Console.