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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: D = None
        self.w: B = None
        self.v: D = None
        self.o: C = None
        self.txt = txt

j = A("j")
a = B("a")
i = C("i")
m = D("m")
n = E("n")
c = C("c")

j.x = n
a.o = j
i.s = m
i.p = m
i.t = m
i.z = a
m.v = j
m.t = j
m.x = a
n.x = a
n.w = a
n.s = m
n.v = m
n.o = c
c.s = m
c.p = m
c.t = m
c.z = a
assert c.s.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: D = None
        self.w: B = None
        self.v: D = None
        self.o: C = None
        self.txt = txt

j = A("j")
a = B("a")
i = C("i")
m = D("m")
n = E("n")
c = C("c")

j.x = n
a.o = j
i.s = m
i.p = m
i.t = m
i.z = a
m.v = j
m.t = j
m.x = a
n.x = a
n.w = a
n.s = m
n.v = m
n.o = c
c.s = m
c.p = m
c.t = m
c.z = a
assert c.s.x.o.txt == "j"