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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

c.q = f
c.v = k
d.o = k
d.x = k
d.r = f
d.y = a
a.x = f
a.u = c
a.s = d
k.o = d
f.t = a
f.o = a
f.z = a
f.w = a
f.s = k
assert c.q.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

c.q = f
c.v = k
d.o = k
d.x = k
d.r = f
d.y = a
a.x = f
a.u = c
a.s = d
k.o = d
f.t = a
f.o = a
f.z = a
f.w = a
f.s = k
assert c.q.s.o.txt == "d"