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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: D = None
        self.q: G = None
        self.p: G = None
        self.w: F = None
        self.u: F = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: F = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: A = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: D = None
        self.q: G = None
        self.p: G = None
        self.w: F = None
        self.u: F = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: F = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: A = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

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

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