Python solution
DFS:\n\nclass Solution:\n    def findLexSmallestString(self, s: str, a: int, b: int) -> str:\n        rec = set()\n        \n        def dfs(s):\n            if
DFS:\n```\nclass Solution:\n    def findLexSmallestString(self, s: str, a: int, b: int) -> str:\n        rec = set()\n        \n        def dfs(s):\n            if s in rec:\n                return           \n            rec.add(s)\n            dfs(s[-b:] + s[:-b])\n            dfs("".join([str((int(c) + a * (i % 2)) % 10) for i, c in enumerate(s)]))\n            \n        dfs(s)\n        return min(rec)\n```\n\nBFS:\n```\nclass Solution:\n    def findLexSmallestString(self, s: str, a: int, b: int) -> str:\n        q = collections.deque([s])\n        rec = set([s])\n        while q:\n            s = q.popleft()\n            s1 = s[-b:] + s[:-b]\n            s2 = "".join([str((int(c) + a * (i % 2)) % 10) for i, c in enumerate(s)])\n            if s1 not in rec:\n                rec.add(s1)\n                q.append(s1)\n            if s2 not in rec:\n                rec.add(s2)\n                q.append(s2)\n        return min(rec)\n```
[]