C++ Solution with Explanation
````\n#define FORI(s,n) for(int i = s; i < n; i++)\n#define FORJ(s,n) for(int j = s; j < n; j++)\n#define FORK(s,n) for(int k = s; k < n; k++)\n\nclass Solution
````\n#define FORI(s,n) for(int i = s; i < n; i++)\n#define FORJ(s,n) for(int j = s; j < n; j++)\n#define FORK(s,n) for(int k = s; k < n; k++)\n\nclass Solution {\npublic:\n    \n    // General idea:\n    // 1. Shave off parentheses of S\n    // 2. Iterate through index 1 to S.len - 1 (where you can put commas)\n    // 3. For each comma position, generate all the possible "numbers" on left and right of comma sepearatly\n    // 4. Make sure each "number" is valid:\n    //    - make sure if decimal exists, number doesn\'t end in zero (A)\n    //    - make sure if all digits aren\'t zero (B)\n    //    - make sure if leading digit is zero, next character is a period (C)\n    // 5. Once you have a valid numbers on left and right, combine them all\n    // 6. Do this for all comma positions, and then put in vector and your done.\n    \n    bool is_valid (string s) {\n        if (s.size () == 1) return true; // check so (C) doesn\'t subscript out of range\n        auto is_dec = [](char c) {return c == \'.\';}; // lambda for (A)\n        if (any_of (s.begin (), s.end (), is_dec) && s[s.size () - 1] == \'0\') return false; // (A)\n        auto is_zero_or_dec = [](char c) { return c == \'0\' || c == \'.\'; }; // lambda for (B)\n        if (all_of (s.begin (), s.end (), is_zero_or_dec)) return false; // (B)\n        if (s[0] == \'0\') return s[1] == \'.\'; // (C)\n        return true;\n    }\n    \n    vector<string> generate (string s) {\n        vector<string> a;\n\n        if (is_valid (s)) a.push_back (s);\n        FORJ (1, s.size ()) {\n            string t = s;\n            t.insert (j, ".");\n            if (is_valid (t)) a.push_back (t);\n        }\n        \n        return a;\n    }\n    \n    vector<string> ambiguousCoordinates(string S) {\n        \n        S = S.substr (1, S.size () - 2); // shave parantheses\n        \n        unordered_set<string> u;\n        \n        FORI (1, S.size ()) {\n            \n            string x = S.substr (0, i);\n            string y = S.substr (i, S.size () - i);\n            \n            vector<string> a = generate (x); // left of comma       \n            vector<string> b = generate (y); // right of comma\n            \n            FORJ (0, a.size ()) {\n                FORK (0, b.size ()) {\n                    u.insert ("(" + a[j] + ", " + b[k] + ")");\n                }\n            }\n        }\n        \n        vector<string> ans;\n        \n        for (const auto& e : u) ans.push_back (e);\n        \n        return ans;\n    }\n};
[]