output_description: Print an index of T where P found in a line. Print the indices in ascending
  order.
input_description: In the first line, a text T is given. In the second line, a string P is given.
attempt: class RKSearch:
      shift = 40
      size = 33554393
  
      def __init__(self, s1, s2):
          self.haystack = self.encode(s1)
          self.needle = self.encode(s2)
  
      def find(self):
          m, n = len(self.haystack), len(self.needle)
          h1 = self.hash(self.haystack, n)
          h2 = self.hash(self.needle, n)
          dm = self.shift ** (n - 1) % self.size
  
          for i in range(m - n + 1):
              if h1 == h2:
                  yield i
              if i + n < m:
                  h1 = (
                      (h1 - self.haystack[i] * dm) * self.shift + self.haystack[i + n]
                  ) % self.size
  
      def hash(self, s, length):
          h = 0
          for i in range(length):
              h = (h * self.shift + s[i]) % self.size
  
          return h
  
      def encode(cls, s):
          basea = int.from_bytes(b"a", "little")
          based = int.from_bytes(b"0", "little")
          bs = []
          for c in s:
              if c.isdigit():
                  bs.append(int.from_bytes(c.encode("utf8"), "little") - based + 27)
              else:
                  bs.append(int.from_bytes(c.encode("utf8"), "little") - basea)
  
          return bs
  
  
  def run():
      s1 = input()
      s2 = input()
      rk = RKSearch(s1, s2)
      for i in rk.find():
          print(i)
  
  
  if __name__ == "__main__":
      run()
  
problem_description: String Search
  
  Find places where a string P is found within a text T. Print all indices of T
  where P found. The indices of T start with 0.
samples: [{"input": "aabaaa\n    aa", "output": "0\n    3\n    4"}, {"input": "xyzz\n    yz", "output": "1"}, {"input": "abc\n    xyz", "output": "The output should be empty."}]