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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: A = None
        self.o: G = None
        self.r: B = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: A = None
        self.o: G = None
        self.r: B = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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