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

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

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

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

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

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

j.z = k
e.u = n
e.y = m
e.t = j
k.z = i
m.v = j
m.u = l
n.v = k
n.y = k
h.v = k
h.y = k
i.z = k
l.v = k
l.y = k
assert m.v.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

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

j.z = k
e.u = n
e.y = m
e.t = j
k.z = i
m.v = j
m.u = l
n.v = k
n.y = k
h.v = k
h.y = k
i.z = k
l.v = k
l.y = k
assert m.v.z.z.txt == "i"