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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: D = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

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

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

a.t = k
c.t = n
c.q = b
j.u = e
j.q = e
j.y = e
j.w = b
n.v = k
n.r = l
n.z = c
k.q = b
k.r = b
k.s = n
k.o = m
b.v = k
b.r = l
b.z = m
e.u = j
e.q = j
e.y = j
e.w = n
l.q = n
l.r = b
l.s = b
l.o = m
m.t = n
m.q = n
assert k.r.r.q.r.s.z.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: D = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

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

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

a.t = k
c.t = n
c.q = b
j.u = e
j.q = e
j.y = e
j.w = b
n.v = k
n.r = l
n.z = c
k.q = b
k.r = b
k.s = n
k.o = m
b.v = k
b.r = l
b.z = m
e.u = j
e.q = j
e.y = j
e.w = n
l.q = n
l.r = b
l.s = b
l.o = m
m.t = n
m.q = n
assert k.r.r.q.r.s.z.t.v.txt == "k"