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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.v: A = None
        self.txt = txt

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

d = A("d")
n = B("n")
e = C("e")
c = B("c")
k = B("k")
l = C("l")

d.z = n
d.w = n
d.u = c
n.s = d
n.v = d
n.y = c
e.s = l
e.w = n
c.s = d
c.v = d
c.y = n
k.s = d
k.v = d
k.y = n
l.s = e
l.w = c
assert c.s.u.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.v: A = None
        self.txt = txt

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

d = A("d")
n = B("n")
e = C("e")
c = B("c")
k = B("k")
l = C("l")

d.z = n
d.w = n
d.u = c
n.s = d
n.v = d
n.y = c
e.s = l
e.w = n
c.s = d
c.v = d
c.y = n
k.s = d
k.v = d
k.y = n
l.s = e
l.w = c
assert c.s.u.s.u.txt == "c"