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

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

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

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

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

a = A("a")
e = B("e")
m = C("m")
h = D("h")
b = E("b")
c = C("c")
g = B("g")
d = B("d")

a.x = m
a.w = b
e.p = c
e.t = a
e.x = m
e.o = b
e.s = g
m.y = b
m.s = h
m.x = e
h.u = c
b.w = g
b.q = a
b.z = a
b.o = h
b.r = c
c.y = b
c.s = h
c.x = g
g.p = c
g.t = a
g.x = m
g.o = b
g.s = e
d.p = m
d.t = a
d.x = c
d.o = b
d.s = g
assert b.w.s.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: E = None
        self.txt = txt

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

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

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

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

a = A("a")
e = B("e")
m = C("m")
h = D("h")
b = E("b")
c = C("c")
g = B("g")
d = B("d")

a.x = m
a.w = b
e.p = c
e.t = a
e.x = m
e.o = b
e.s = g
m.y = b
m.s = h
m.x = e
h.u = c
b.w = g
b.q = a
b.z = a
b.o = h
b.r = c
c.y = b
c.s = h
c.x = g
g.p = c
g.t = a
g.x = m
g.o = b
g.s = e
d.p = m
d.t = a
d.x = c
d.o = b
d.s = g
assert b.w.s.x.y.txt == "b"