class Solution(object):
    def repeatedSubstringPattern(self, s):
        """
        :type s: str
        :rtype: bool
        """
        for i in range(1,int(len(s)/2)+1):
            if len(s)%i==0:
                x=s[:i]
                index=0
                for j in range(0,len(s),i):
                    if x!=s[j:j+i]:
                        index=1
                        break
                if index==0:
                    return True
        return False


s = Solution()
str="abcabcabcabc"
print(s.repeatedSubstringPattern(str))
