import re
def increment_string(strng):
return re.sub(r'[0-9]+$', lambda x: f"{str(int(x.group())+1).zfill(len(x.group()))}", strng)
print(increment_string("abcd99"))
print(increment_string("abcd099"))
print(increment_string("abcd001"))
aW1wb3J0IHJlCmRlZiBpbmNyZW1lbnRfc3RyaW5nKHN0cm5nKToKICAgIHJldHVybiByZS5zdWIocidbMC05XSskJywgbGFtYmRhIHg6IGYie3N0cihpbnQoeC5ncm91cCgpKSsxKS56ZmlsbChsZW4oeC5ncm91cCgpKSl9Iiwgc3RybmcpCgpwcmludChpbmNyZW1lbnRfc3RyaW5nKCJhYmNkOTkiKSkKcHJpbnQoaW5jcmVtZW50X3N0cmluZygiYWJjZDA5OSIpKQpwcmludChpbmNyZW1lbnRfc3RyaW5nKCJhYmNkMDAxIikp