class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

h = A("h")
a = B("a")
i = C("i")
c = B("c")
e = B("e")
d = A("d")
k = C("k")
n = B("n")

h.x = n
a.w = e
a.q = i
a.y = i
i.w = k
i.u = k
i.z = d
c.w = a
c.q = i
c.y = i
e.w = n
e.q = k
e.y = k
d.x = e
k.w = i
k.u = i
k.z = d
n.w = c
n.q = i
n.y = k
assert h.x.w.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

h = A("h")
a = B("a")
i = C("i")
c = B("c")
e = B("e")
d = A("d")
k = C("k")
n = B("n")

h.x = n
a.w = e
a.q = i
a.y = i
i.w = k
i.u = k
i.z = d
c.w = a
c.q = i
c.y = i
e.w = n
e.q = k
e.y = k
d.x = e
k.w = i
k.u = i
k.z = d
n.w = c
n.q = i
n.y = k
assert h.x.w.w.y.txt == "i"