class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: C = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

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

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

l.u = c
l.p = j
l.s = m
c.z = m
c.q = b
c.u = h
b.v = d
b.p = d
b.x = h
b.o = e
m.w = k
m.t = b
m.r = b
m.q = e
k.q = l
h.u = e
h.p = l
h.s = m
j.u = c
j.p = h
j.s = m
d.v = a
d.x = l
d.p = b
d.o = c
a.v = d
a.p = d
a.x = j
a.o = c
e.z = m
e.q = a
e.u = h
assert l.u.q.o.u.u.z.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: C = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

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

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

l.u = c
l.p = j
l.s = m
c.z = m
c.q = b
c.u = h
b.v = d
b.p = d
b.x = h
b.o = e
m.w = k
m.t = b
m.r = b
m.q = e
k.q = l
h.u = e
h.p = l
h.s = m
j.u = c
j.p = h
j.s = m
d.v = a
d.x = l
d.p = b
d.o = c
a.v = d
a.p = d
a.x = j
a.o = c
e.z = m
e.q = a
e.u = h
assert l.u.q.o.u.u.z.r.x.txt == "h"