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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: D = None
        self.p: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: D = None
        self.p: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

c.q = f
c.z = f
c.t = f
c.r = i
i.t = n
i.y = f
i.p = c
i.z = c
l.o = c
l.s = c
l.t = m
l.y = n
l.x = n
m.t = i
m.p = n
m.r = n
m.s = f
n.x = l
f.t = i
f.p = n
f.r = n
f.s = m
assert n.x.y.x.s.txt == "c"