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

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

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

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

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

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

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

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

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

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

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

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

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