from typing import Dict
from typing import Optional
from typing import List
from typing import Tuple


def tiered_extract(db: Dict[str, Dict[str, Dict[str, Optional[str]]]]) -> List[Tuple[str, str]]:
  """From a three-level deep nested dictionary, return a list of (key, values)
  of the deepest level."""
  out = []
  for entry in db.values():
    for values in entry.values():
      for name, decl in values.items():
        if decl and '/' not in decl:
          out.append((name, decl))
  return out