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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: J = None
        self.v: H = None
        self.t: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: D = None
        self.q: I = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: I = None
        self.x: I = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: G = None
        self.s: J = None
        self.w: H = None
        self.o: J = None
        self.t: J = None
        self.v: J = None
        self.u: D = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.s: I = None
        self.z: F = None
        self.r: D = None
        self.q: F = None
        self.txt = txt

b = A("b")
i = B("i")
h = C("h")
l = D("l")
f = E("f")
k = F("k")
e = G("e")
j = H("j")
m = I("m")
d = J("d")

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: J = None
        self.v: H = None
        self.t: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: D = None
        self.q: I = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: I = None
        self.x: I = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: G = None
        self.s: J = None
        self.w: H = None
        self.o: J = None
        self.t: J = None
        self.v: J = None
        self.u: D = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.s: I = None
        self.z: F = None
        self.r: D = None
        self.q: F = None
        self.txt = txt

b = A("b")
i = B("i")
h = C("h")
l = D("l")
f = E("f")
k = F("k")
e = G("e")
j = H("j")
m = I("m")
d = J("d")

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