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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

i = A("i")
c = B("c")
e = C("e")
h = D("h")
j = E("j")

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

i = A("i")
c = B("c")
e = C("e")
h = D("h")
j = E("j")

i.r = e
i.u = e
i.y = h
i.z = c
c.t = e
c.r = h
c.o = i
e.y = c
h.z = e
j.x = c
j.r = c
j.z = h
j.p = e
assert i.u.y.o.r.y.txt == "c"