class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: B = None
        self.u: D = None
        self.s: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

n = A("n")
d = B("d")
k = C("k")
l = D("l")
e = E("e")
b = D("b")

n.x = e
n.v = e
n.y = d
n.u = l
n.s = k
d.x = k
d.w = l
d.z = e
k.r = e
k.w = e
k.s = e
k.v = d
l.q = d
e.r = d
e.v = d
b.q = d
assert b.q.w.q.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: B = None
        self.u: D = None
        self.s: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

n = A("n")
d = B("d")
k = C("k")
l = D("l")
e = E("e")
b = D("b")

n.x = e
n.v = e
n.y = d
n.u = l
n.s = k
d.x = k
d.w = l
d.z = e
k.r = e
k.w = e
k.s = e
k.v = d
l.q = d
e.r = d
e.v = d
b.q = d
assert b.q.w.q.w.q.txt == "d"