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

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

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

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

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

f = A("f")
k = B("k")
l = C("l")
j = D("j")
n = E("n")
b = E("b")
i = C("i")
a = C("a")

f.s = l
f.x = k
k.w = j
l.q = k
l.u = j
j.y = b
j.w = l
n.z = k
n.v = j
b.z = k
b.v = j
i.q = k
i.u = j
a.q = k
a.u = j
assert l.q.w.w.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

f = A("f")
k = B("k")
l = C("l")
j = D("j")
n = E("n")
b = E("b")
i = C("i")
a = C("a")

f.s = l
f.x = k
k.w = j
l.q = k
l.u = j
j.y = b
j.w = l
n.z = k
n.v = j
b.z = k
b.v = j
i.q = k
i.u = j
a.q = k
a.u = j
assert l.q.w.w.u.w.txt == "l"