input: Write a python function to build an inverted index for a list of documents and query it.
  assert build_index(['hello world', 'hello world wide web']) == {'hello': [(0, 0), (1, 0)], 'world': [(0, 1), (1, 1)], 'wide': [(1, 2)], 'web': [(1, 3)]}
  assert query(build_index(['abc def', 'ghi jkl abc']), 'abc') == [(0, 0), (1, 2)]
  assert query(build_index(['test case', 'another test case']), 'case') == [(0, 1), (1, 2)]
output: def build_index(documents):
      index = {}
      for doc_id, doc in enumerate(documents):
          for word_pos, word in enumerate(doc.split()):
              if word not in index:
                  index[word] = []
              index[word].append((doc_id, word_pos))
      return index
  
  def query(index, term):
      return index.get(term, [])