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

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

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

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

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

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

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

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

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

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

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

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

e.s = j
e.u = l
h.p = i
h.y = m
j.z = l
j.w = l
m.w = c
m.y = j
m.s = h
l.v = m
l.o = j
l.t = j
i.s = j
i.u = l
c.w = m
c.y = j
c.s = h
assert m.y.z.t.txt == "j"