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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.q: C = None
        self.txt = txt

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

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

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

i = A("i")
c = B("c")
h = C("h")
f = D("f")
m = E("m")

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.q: C = None
        self.txt = txt

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

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

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

i = A("i")
c = B("c")
h = C("h")
f = D("f")
m = E("m")

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