class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: A = None
        self.o: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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