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

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

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

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

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

j = A("j")
l = B("l")
k = C("k")
n = D("n")
f = E("f")
d = B("d")
c = E("c")
h = D("h")

j.r = d
j.q = c
l.w = d
l.z = k
l.x = k
l.t = h
k.v = j
k.w = j
k.u = h
k.x = f
n.z = l
n.x = d
f.x = c
f.s = n
f.v = h
d.w = l
d.z = k
d.x = k
d.t = h
c.x = f
c.s = h
c.v = h
h.z = d
h.x = l
assert k.v.q.s.z.z.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

j = A("j")
l = B("l")
k = C("k")
n = D("n")
f = E("f")
d = B("d")
c = E("c")
h = D("h")

j.r = d
j.q = c
l.w = d
l.z = k
l.x = k
l.t = h
k.v = j
k.w = j
k.u = h
k.x = f
n.z = l
n.x = d
f.x = c
f.s = n
f.v = h
d.w = l
d.z = k
d.x = k
d.t = h
c.x = f
c.s = h
c.v = h
h.z = d
h.x = l
assert k.v.q.s.z.z.u.x.txt == "l"