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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: B = None
        self.y: C = None
        self.t: A = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: B = None
        self.y: C = None
        self.t: A = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

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

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