 }
 
 class Apartment3 {
-    let number: Int
-    init(number: Int) { self.number = number }
+    let unit: String
+    init(unit: String) { self.unit = unit }
     weak var tenant: Person3?
-    deinit { print("Apartment #\(number) is being deinitialized") }
+    deinit { print("Apartment #\(unit) is being deinitialized") }
 }
 
 var james: Person3?
 var number74: Apartment3?
 
 james = Person3(name: "James Appleseed")
-number74 = Apartment3(number: 74)
+number74 = Apartment3(unit: "74")
 
 james!.apartment = number74
 number74!.tenant = james

        print("\(name) is being deinitialized")
    }
}

var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world")
print(paragraph!.asHTML())

}

class Apartment {
    let unit: String
    init(unit: String) { self.unit = unit }
    var tenant: Person2?
    deinit { print("Apartment #\(unit) is being deinitialized") }
}

var john: Person2?
var unit4A: Apartment?

john = Person2(name: "John Appleseed")
unit4A = Apartment(unit: "4A")

john!.apartment = unit4A
unit4A!.tenant = john

//  Unfortunately, linking these two instances creates a strong reference cycle between them. The Person instance now has a strong reference to the Apartment instance, and the Apartment instance has a strong reference to the Person instance. Therefore, when you break the strong references held by the john and number73 variables, the reference counts do not drop to zero, and the instances are not deallocated by ARC:

john = nil
unit4A = nil
// We have now leaked memory

// Resolving Strong Reference Cycles between Class Instances
