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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.y: D = None
        self.z: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: E = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.s: A = None
        self.t: E = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: A = None
        self.q: A = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.y: D = None
        self.z: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: E = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.s: A = None
        self.t: E = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: A = None
        self.q: A = None
        self.z: B = None
        self.txt = txt

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

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