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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: A = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

c = A("c")
i = B("i")
b = C("b")
h = D("h")
a = D("a")
e = B("e")
l = A("l")
n = C("n")

c.z = n
c.v = n
i.t = b
i.q = c
i.o = l
b.t = i
h.y = a
a.y = h
e.t = b
e.q = c
e.o = c
l.z = n
l.v = n
n.t = e
assert c.v.t.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: A = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

c = A("c")
i = B("i")
b = C("b")
h = D("h")
a = D("a")
e = B("e")
l = A("l")
n = C("n")

c.z = n
c.v = n
i.t = b
i.q = c
i.o = l
b.t = i
h.y = a
a.y = h
e.t = b
e.q = c
e.o = c
l.z = n
l.v = n
n.t = e
assert c.v.t.o.v.txt == "n"