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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.r: A = None
        self.txt = txt

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

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

e = A("e")
j = B("j")
c = C("c")
h = D("h")
l = B("l")
d = B("d")
i = B("i")
n = A("n")

e.z = l
j.t = d
j.y = h
j.r = n
c.w = d
c.v = l
h.o = j
l.t = i
l.y = h
l.r = n
d.t = i
d.y = h
d.r = n
i.t = j
i.y = h
i.r = n
n.z = l
assert e.z.r.z.y.o.y.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.r: A = None
        self.txt = txt

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

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

e = A("e")
j = B("j")
c = C("c")
h = D("h")
l = B("l")
d = B("d")
i = B("i")
n = A("n")

e.z = l
j.t = d
j.y = h
j.r = n
c.w = d
c.v = l
h.o = j
l.t = i
l.y = h
l.r = n
d.t = i
d.y = h
d.r = n
i.t = j
i.y = h
i.r = n
n.z = l
assert e.z.r.z.y.o.y.o.y.txt == "h"