class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: C = None
        self.t: B = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

k = A("k")
n = B("n")
j = C("j")
l = D("l")
b = E("b")
g = C("g")

k.w = b
n.z = b
j.x = n
j.w = g
l.q = b
l.r = g
l.t = n
l.o = n
l.y = j
b.v = g
g.x = n
g.w = j
assert j.x.z.v.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: C = None
        self.t: B = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

k = A("k")
n = B("n")
j = C("j")
l = D("l")
b = E("b")
g = C("g")

k.w = b
n.z = b
j.x = n
j.w = g
l.q = b
l.r = g
l.t = n
l.o = n
l.y = j
b.v = g
g.x = n
g.w = j
assert j.x.z.v.w.x.txt == "n"