# your code goes here
def save_state(self):
s = shelve.open('myshelf')
s['myclass'] = self
s.close()
print("Saved state of structure to file.")
def __del__(self):
self.save_state()
IyB5b3VyIGNvZGUgZ29lcyBoZXJlCmRlZiBzYXZlX3N0YXRlKHNlbGYpOgoJcyA9IHNoZWx2ZS5vcGVuKCdteXNoZWxmJykKCXNbJ215Y2xhc3MnXSA9IHNlbGYKCXMuY2xvc2UoKQoJcHJpbnQoIlNhdmVkIHN0YXRlIG9mIHN0cnVjdHVyZSB0byBmaWxlLiIpCgkKZGVmIF9fZGVsX18oc2VsZik6CiAgICBzZWxmLnNhdmVfc3RhdGUoKQ==