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

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

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

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

c = A("c")
i = B("i")
g = C("g")
h = D("h")
k = B("k")
e = C("e")
l = D("l")

c.u = i
i.v = h
g.t = l
g.u = c
h.t = g
h.v = g
h.z = e
h.u = k
k.v = l
e.t = l
e.u = c
l.t = e
l.v = e
l.z = g
l.u = k
assert e.u.u.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

c = A("c")
i = B("i")
g = C("g")
h = D("h")
k = B("k")
e = C("e")
l = D("l")

c.u = i
i.v = h
g.t = l
g.u = c
h.t = g
h.v = g
h.z = e
h.u = k
k.v = l
e.t = l
e.u = c
l.t = e
l.v = e
l.z = g
l.u = k
assert e.u.u.v.z.txt == "e"