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

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

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

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

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

f = A("f")
c = B("c")
k = C("k")
g = D("g")
d = E("d")

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

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

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

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

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

f = A("f")
c = B("c")
k = C("k")
g = D("g")
d = E("d")

f.s = k
f.z = d
f.o = d
f.q = d
f.t = c
c.w = f
c.q = g
k.x = g
k.u = g
g.p = k
g.v = k
g.s = k
g.u = f
d.v = f
assert g.s.u.s.txt == "k"