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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: E = None
        self.o: D = None
        self.t: A = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: C = None
        self.s: E = None
        self.w: E = None
        self.txt = txt

l = A("l")
m = B("m")
i = C("i")
b = D("b")
e = E("e")
h = E("h")

l.s = h
m.y = b
m.u = l
m.t = i
m.r = i
i.v = b
i.o = b
i.u = e
i.t = l
i.z = m
b.r = l
b.z = l
b.w = h
e.x = i
e.y = i
e.s = h
e.w = h
h.x = i
h.y = i
h.s = e
h.w = e
assert h.w.s.s.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: E = None
        self.o: D = None
        self.t: A = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: C = None
        self.s: E = None
        self.w: E = None
        self.txt = txt

l = A("l")
m = B("m")
i = C("i")
b = D("b")
e = E("e")
h = E("h")

l.s = h
m.y = b
m.u = l
m.t = i
m.r = i
i.v = b
i.o = b
i.u = e
i.t = l
i.z = m
b.r = l
b.z = l
b.w = h
e.x = i
e.y = i
e.s = h
e.w = h
h.x = i
h.y = i
h.s = e
h.w = e
assert h.w.s.s.s.y.txt == "i"