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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.u: D = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

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

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

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

m.x = i
m.t = a
e.o = n
n.o = m
n.p = m
n.q = m
n.z = m
n.u = l
l.x = k
c.q = a
c.v = l
c.x = m
k.x = l
a.q = i
a.v = k
a.x = m
i.q = c
i.v = k
i.x = m
h.o = n
assert n.q.x.v.x.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.u: D = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

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

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

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

m.x = i
m.t = a
e.o = n
n.o = m
n.p = m
n.q = m
n.z = m
n.u = l
l.x = k
c.q = a
c.v = l
c.x = m
k.x = l
a.q = i
a.v = k
a.x = m
i.q = c
i.v = k
i.x = m
h.o = n
assert n.q.x.v.x.x.x.x.x.txt == "l"