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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.z: E = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.z: E = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

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

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

j.u = e
l.r = m
l.y = j
l.z = j
d.x = m
d.o = l
m.v = j
m.y = j
m.x = j
m.z = k
m.s = l
k.z = j
k.v = h
k.t = h
k.o = h
n.z = j
n.v = k
n.t = h
n.o = h
h.z = j
h.v = n
h.t = k
h.o = k
e.x = m
e.o = l
assert d.x.z.z.u.x.z.z.u.txt == "e"