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

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

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

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

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

b = A("b")
l = B("l")
d = C("d")
h = D("h")
g = E("g")
k = E("k")
i = E("i")
j = D("j")

b.w = d
b.x = d
b.s = l
b.t = h
l.x = j
l.r = g
l.v = h
l.s = b
d.p = h
d.x = h
d.z = b
h.q = d
g.u = b
g.t = l
g.z = l
k.u = b
k.t = l
k.z = l
i.u = b
i.t = l
i.z = l
j.q = d
assert b.w.z.s.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: B = None
        self.t: D = None
        self.x: C = None
        self.txt = txt

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

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

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

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

b = A("b")
l = B("l")
d = C("d")
h = D("h")
g = E("g")
k = E("k")
i = E("i")
j = D("j")

b.w = d
b.x = d
b.s = l
b.t = h
l.x = j
l.r = g
l.v = h
l.s = b
d.p = h
d.x = h
d.z = b
h.q = d
g.u = b
g.t = l
g.z = l
k.u = b
k.t = l
k.z = l
i.u = b
i.t = l
i.z = l
j.q = d
assert b.w.z.s.x.q.txt == "d"