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

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

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

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

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

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

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

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

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

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

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

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

i.p = j
i.o = c
i.s = m
c.o = j
c.z = j
c.y = j
c.t = a
m.p = j
j.u = c
j.z = a
j.r = a
a.p = m
a.u = c
a.s = j
a.w = j
assert j.u.z.r.txt == "a"