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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.r: H = None
        self.y: A = None
        self.p: H = None
        self.v: H = None
        self.w: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

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

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

d.t = k
d.z = g
k.p = b
n.w = k
n.s = k
n.z = i
n.v = i
n.t = g
e.u = b
e.y = b
e.z = i
e.r = g
e.p = g
e.v = g
e.w = h
c.x = n
i.s = d
i.o = g
a.z = n
a.p = i
a.y = i
g.p = c
g.r = k
g.o = k
b.t = k
b.z = g
h.u = b
h.y = b
h.z = i
h.r = g
h.p = g
h.v = g
h.w = e
assert n.z.s.z.o.p.z.o.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.r: H = None
        self.y: A = None
        self.p: H = None
        self.v: H = None
        self.w: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

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

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

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