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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.r: H = None
        self.x: G = None
        self.u: D = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: G = None
        self.z: E = None
        self.t: H = None
        self.o: D = None
        self.s: G = None
        self.r: E = None
        self.x: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: C = None
        self.v: H = None
        self.y: H = None
        self.w: H = None
        self.t: H = None
        self.q: B = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.x: B = None
        self.y: D = None
        self.u: E = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.q: G = None
        self.z: D = None
        self.txt = txt

h = A("h")
g = B("g")
l = C("l")
i = D("i")
f = E("f")
n = F("n")
m = G("m")
b = H("b")
d = H("d")
j = G("j")

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.r: H = None
        self.x: G = None
        self.u: D = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: G = None
        self.z: E = None
        self.t: H = None
        self.o: D = None
        self.s: G = None
        self.r: E = None
        self.x: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: C = None
        self.v: H = None
        self.y: H = None
        self.w: H = None
        self.t: H = None
        self.q: B = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.x: B = None
        self.y: D = None
        self.u: E = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.q: G = None
        self.z: D = None
        self.txt = txt

h = A("h")
g = B("g")
l = C("l")
i = D("i")
f = E("f")
n = F("n")
m = G("m")
b = H("b")
d = H("d")
j = G("j")

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