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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.r: E = None
        self.t: A = None
        self.q: C = None
        self.z: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.p: A = None
        self.u: F = None
        self.s: B = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.x: E = None
        self.z: D = None
        self.s: F = None
        self.u: A = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
e = D("e")
m = E("m")
h = F("h")
g = C("g")
d = F("d")
l = C("l")
j = C("j")

b.u = k
b.q = h
b.w = l
k.t = b
k.p = m
i.p = e
i.y = e
i.r = m
i.t = b
i.q = j
i.z = l
e.t = k
e.s = k
e.z = b
e.p = b
e.u = h
e.w = m
m.p = h
m.q = b
h.t = m
h.x = m
h.p = l
h.z = e
h.s = d
h.u = b
g.p = e
g.y = e
g.r = m
g.t = b
g.q = j
g.z = l
d.t = m
d.x = m
d.p = g
d.z = e
d.s = h
d.u = b
l.p = e
l.y = e
l.r = m
l.t = b
l.q = j
l.z = i
j.p = e
j.y = e
j.r = m
j.t = b
j.q = i
j.z = g
assert i.z.z.z.q.z.t.w.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.r: E = None
        self.t: A = None
        self.q: C = None
        self.z: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.p: A = None
        self.u: F = None
        self.s: B = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.x: E = None
        self.z: D = None
        self.s: F = None
        self.u: A = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
e = D("e")
m = E("m")
h = F("h")
g = C("g")
d = F("d")
l = C("l")
j = C("j")

b.u = k
b.q = h
b.w = l
k.t = b
k.p = m
i.p = e
i.y = e
i.r = m
i.t = b
i.q = j
i.z = l
e.t = k
e.s = k
e.z = b
e.p = b
e.u = h
e.w = m
m.p = h
m.q = b
h.t = m
h.x = m
h.p = l
h.z = e
h.s = d
h.u = b
g.p = e
g.y = e
g.r = m
g.t = b
g.q = j
g.z = l
d.t = m
d.x = m
d.p = g
d.z = e
d.s = h
d.u = b
l.p = e
l.y = e
l.r = m
l.t = b
l.q = j
l.z = i
j.p = e
j.y = e
j.r = m
j.t = b
j.q = i
j.z = g
assert i.z.z.z.q.z.t.w.r.q.txt == "b"