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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.q: C = None
        self.u: F = None
        self.p: A = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: C = None
        self.r: H = None
        self.z: F = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.o: G = None
        self.w: G = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: C = None
        self.o: A = None
        self.v: G = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

b = A("b")
a = B("a")
h = C("h")
j = D("j")
g = E("g")
k = F("k")
e = G("e")
i = H("i")
d = G("d")

b.u = h
b.z = e
a.s = k
a.u = k
a.y = h
a.q = h
a.p = b
a.o = j
h.z = a
h.w = g
h.r = d
j.y = e
j.w = h
j.r = i
j.z = k
j.s = g
g.u = j
g.p = h
g.o = d
g.w = e
g.v = k
g.t = a
k.r = d
k.t = h
k.s = h
k.o = b
k.v = e
e.w = d
e.o = d
i.t = j
i.v = h
i.z = k
d.w = e
d.o = e
assert h.r.w.w.o.w.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.q: C = None
        self.u: F = None
        self.p: A = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: C = None
        self.r: H = None
        self.z: F = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.o: G = None
        self.w: G = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: C = None
        self.o: A = None
        self.v: G = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

b = A("b")
a = B("a")
h = C("h")
j = D("j")
g = E("g")
k = F("k")
e = G("e")
i = H("i")
d = G("d")

b.u = h
b.z = e
a.s = k
a.u = k
a.y = h
a.q = h
a.p = b
a.o = j
h.z = a
h.w = g
h.r = d
j.y = e
j.w = h
j.r = i
j.z = k
j.s = g
g.u = j
g.p = h
g.o = d
g.w = e
g.v = k
g.t = a
k.r = d
k.t = h
k.s = h
k.o = b
k.v = e
e.w = d
e.o = d
i.t = j
i.v = h
i.z = k
d.w = e
d.o = e
assert h.r.w.w.o.w.o.o.o.o.txt == "d"