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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.y: C = None
        self.s: A = None
        self.u: A = None
        self.z: D = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

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

n.o = a
n.t = a
n.z = l
n.p = c
n.r = h
a.w = l
a.u = h
a.t = g
l.z = c
l.r = c
c.p = a
h.r = a
i.y = g
g.s = n
g.u = c
g.o = f
g.z = a
f.o = n
f.s = n
f.u = n
f.x = i
f.w = i
f.y = l
f.z = c
f.p = h
assert h.r.w.z.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.t: B = None
        self.p: D = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.y: C = None
        self.s: A = None
        self.u: A = None
        self.z: D = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

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

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