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

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

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

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

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

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

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

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

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

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

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

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

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