input: Write a function to print the directory structure given in the form of a nested dictionary.
  assert print_directory_structure({"root": {"Projects": {"Python": {"Scripts": {"script1.py": null, "script2.py": null}}, "JavaScript": {"Scripts": {"script1.js": null, "script2.js": null}}}, "Documents": {"paper1.pdf": null, "paper2.pdf": null}}}) == "root\n  Projects\n    Python\n      Scripts\n        script1.py\n        script2.py\n    JavaScript\n      Scripts\n        script1.js\n        script2.js\n  Documents\n    paper1.pdf\n    paper2.pdf"
  assert print_directory_structure({"root": {"Folder1": {"Subfolder1": {"file1.txt": null}}, "Folder2": {"file2.txt": null}}}) == "root\n  Folder1\n    Subfolder1\n      file1.txt\n  Folder2\n    file2.txt"
output: def print_directory_structure(d):
      def build_structure(d, indent=0):
          result = []
          for key, value in d.items():
              result.append('  ' * indent + key)
              if isinstance(value, dict):
                  result.extend(build_structure(value, indent + 1))
          return result
      
      lines = build_structure(d)
      return '\n'.join(lines)