class Solution:
    def compareVersion(self, version1: str, version2: str) -> int:
        reversion1 = version1.split(".")
        reversion2 = version2.split(".")

        for i in range(max(len(reversion1), len(reversion2))):
            if i >= len(reversion1):
                if int(reversion2[i])!=0:
                    return -1
                else:
                    continue
            if i >= len(reversion2):
                if int(reversion1[i]) != 0:
                    return 1
                else:
                    continue

            rev1=int(reversion1[i])
            rev2=int(reversion2[i])
            if rev1>rev2:
                return 1
            elif rev1<rev2:
                return -1

        return 0

sol=Solution()
rlt=sol.compareVersion("1.0.1","1.001")
print(rlt)
rlt=sol.compareVersion("1.01","1.001")
print(rlt)
rlt=sol.compareVersion("1.0","1.0.0")
print(rlt)
rlt=sol.compareVersion("2.0","1.0.0")
print(rlt)
rlt=sol.compareVersion("1.2.0","1.0.0")
print(rlt)
rlt=sol.compareVersion("1.0.0","1.0.2")
print(rlt)
rlt=sol.compareVersion("1.0.0.3","1.0.2")
print(rlt)
