





'''simple docstring'''


_SCREAMING_SNAKE_CASE									=				2_56
# Modulus to hash a string
_SCREAMING_SNAKE_CASE									=				1_00_00_03


def 						__a(SCREAMING_SNAKE_CASE_	:       str		,							SCREAMING_SNAKE_CASE_	:       str     ):



    '''simple docstring'''





    _lowerCAmelCase						      =   len(SCREAMING_SNAKE_CASE_     )
    _lowerCAmelCase						      =   len(SCREAMING_SNAKE_CASE_     )
    if p_len > t_len:
        return False

    _lowerCAmelCase						      =   0
    _lowerCAmelCase						      =   0
    _lowerCAmelCase						      =   1

    # Calculating the hash of pattern and substring of text
    for i in range(SCREAMING_SNAKE_CASE_     ):
        _lowerCAmelCase						      =   (ord(pattern[i]     ) + p_hash * alphabet_size) % modulus
        _lowerCAmelCase						      =   (ord(text[i]     ) + text_hash * alphabet_size) % modulus
        if i == p_len - 1:
            continue
        _lowerCAmelCase						      =   (modulus_power * alphabet_size) % modulus

    for i in range(0		,							t_len - p_len + 1     ):
        if text_hash == p_hash and text[i : i + p_len] == pattern:
            return True
        if i == t_len - p_len:
            continue
        # Calculate the https://en.wikipedia.org/wiki/Rolling_hash
        _lowerCAmelCase						      =   (
            (text_hash - ord(text[i]     ) * modulus_power) * alphabet_size
            + ord(text[i + p_len]     )
        ) % modulus
    return False


def 						__a():



    '''simple docstring'''





    _lowerCAmelCase						      =   "abc1abc12"
    _lowerCAmelCase						      =   "alskfjaldsabc1abc1abc12k23adsfabcabc"
    _lowerCAmelCase						      =   "alskfjaldsk23adsfabcabc"
    assert rabin_karp(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     ) and not rabin_karp(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )

    # Test 2)
    _lowerCAmelCase						      =   "ABABX"
    _lowerCAmelCase						      =   "ABABZABABYABABX"
    assert rabin_karp(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )

    # Test 3)
    _lowerCAmelCase						      =   "AAAB"
    _lowerCAmelCase						      =   "ABAAAAAB"
    assert rabin_karp(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )

    # Test 4)
    _lowerCAmelCase						      =   "abcdabcy"
    _lowerCAmelCase						      =   "abcxabcdabxabcdabcdabcy"
    assert rabin_karp(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )

    # Test 5)
    _lowerCAmelCase						      =   "Lü"
    _lowerCAmelCase						      =   "Lüsai"
    assert rabin_karp(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )
    _lowerCAmelCase						      =   "Lue"
    assert not rabin_karp(SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )
    print("Success."     )


if __name__ == "__main__":
       test_rabin_karp()








'''simple docstring'''







def 						_A      ( ):






   '''simple docstring'''







   A__       =     [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

   A__       =     6
   A__       =     1
   A__       =     1901

   A__       =     0

   while year < 2001:
      day += 7

      if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
         if day > days_per_month[month - 1] and month != 2:
            month += 1
            A__       =     day - days_per_month[month - 2]
         elif day > 29 and month == 2:
            month += 1
            A__       =     day - 29
      else:
         if day > days_per_month[month - 1]:
            month += 1
            A__       =     day - days_per_month[month - 2]

      if month > 12:
         year += 1
         A__       =     1

      if year < 2001 and day == 1:
         sundays += 1
   return sundays


if __name__ == "__main__":
    print(solution())


