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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.x: B = None
        self.p: A = None
        self.r: C = None
        self.txt = txt

a = A("a")
k = B("k")
c = C("c")
e = D("e")
l = E("l")
h = B("h")
i = D("i")

a.x = i
a.s = c
k.w = h
k.v = i
k.y = a
k.x = c
k.o = c
c.y = e
c.r = i
e.z = i
e.v = c
e.p = c
l.v = k
l.x = k
l.u = c
l.r = c
l.p = a
h.w = k
h.v = e
h.y = a
h.x = c
h.o = c
i.z = e
i.v = c
i.p = c
assert h.o.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.x: B = None
        self.p: A = None
        self.r: C = None
        self.txt = txt

a = A("a")
k = B("k")
c = C("c")
e = D("e")
l = E("l")
h = B("h")
i = D("i")

a.x = i
a.s = c
k.w = h
k.v = i
k.y = a
k.x = c
k.o = c
c.y = e
c.r = i
e.z = i
e.v = c
e.p = c
l.v = k
l.x = k
l.u = c
l.r = c
l.p = a
h.w = k
h.v = e
h.y = a
h.x = c
h.o = c
i.z = e
i.v = c
i.p = c
assert h.o.r.z.txt == "e"