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

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

class C:
    def __init__(self, txt: str):
        self.u: E = 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: E = None
        self.r: C = None
        self.v: D = None
        self.z: D = None
        self.t: A = None
        self.txt = txt

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

n.t = m
n.x = i
n.u = e
d.x = n
d.o = n
d.w = h
d.z = e
h.u = m
j.z = l
m.x = b
m.r = l
m.v = j
m.z = f
m.t = n
b.x = m
b.r = l
b.v = j
b.z = j
b.t = n
i.u = b
l.u = m
f.z = i
e.x = n
e.o = n
e.w = i
e.z = d
assert j.z.u.x.t.x.u.z.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = 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: E = None
        self.r: C = None
        self.v: D = None
        self.z: D = None
        self.t: A = None
        self.txt = txt

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

n.t = m
n.x = i
n.u = e
d.x = n
d.o = n
d.w = h
d.z = e
h.u = m
j.z = l
m.x = b
m.r = l
m.v = j
m.z = f
m.t = n
b.x = m
b.r = l
b.v = j
b.z = j
b.t = n
i.u = b
l.u = m
f.z = i
e.x = n
e.o = n
e.w = i
e.z = d
assert j.z.u.x.t.x.u.z.z.u.txt == "m"