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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.txt = txt

e = A("e")
l = B("l")
i = C("i")
g = D("g")
f = D("f")

e.u = i
e.t = i
e.s = i
l.r = e
l.y = e
l.s = e
l.z = i
i.w = g
i.t = g
i.z = f
i.r = e
g.x = i
g.q = i
f.x = i
f.q = i
assert l.z.r.s.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.txt = txt

e = A("e")
l = B("l")
i = C("i")
g = D("g")
f = D("f")

e.u = i
e.t = i
e.s = i
l.r = e
l.y = e
l.s = e
l.z = i
i.w = g
i.t = g
i.z = f
i.r = e
g.x = i
g.q = i
f.x = i
f.q = i
assert l.z.r.s.w.q.txt == "i"