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

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

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

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

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

d = A("d")
l = B("l")
j = C("j")
a = D("a")
i = E("i")
n = D("n")

d.r = j
d.q = j
d.z = l
d.w = a
d.s = i
l.o = i
j.w = d
j.o = l
j.t = l
a.x = i
a.w = i
a.v = j
a.q = n
a.z = d
i.z = l
i.r = j
i.s = j
n.x = i
n.w = i
n.v = j
n.q = a
n.z = d
assert d.s.z.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.z: B = None
        self.w: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
j = C("j")
a = D("a")
i = E("i")
n = D("n")

d.r = j
d.q = j
d.z = l
d.w = a
d.s = i
l.o = i
j.w = d
j.o = l
j.t = l
a.x = i
a.w = i
a.v = j
a.q = n
a.z = d
i.z = l
i.r = j
i.s = j
n.x = i
n.w = i
n.v = j
n.q = a
n.z = d
assert d.s.z.o.s.txt == "j"