class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: C = None
        self.s: C = None
        self.r: C = None
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: A = None
        self.o: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: C = None
        self.y: G = None
        self.v: A = None
        self.q: I = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: E = None
        self.q: D = None
        self.o: A = None
        self.z: G = None
        self.v: A = None
        self.w: G = None
        self.x: H = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: F = None
        self.q: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

d = A("d")
h = B("h")
l = C("l")
m = D("m")
g = E("g")
k = F("k")
a = G("a")
e = H("e")
f = I("f")
n = C("n")

d.z = a
d.x = l
d.r = l
d.s = n
d.o = e
h.w = e
h.v = d
h.o = g
h.s = m
l.z = a
l.y = a
l.p = n
l.v = d
l.q = f
l.o = k
m.p = e
m.u = d
m.v = d
m.r = f
g.s = h
g.v = h
g.z = m
k.p = f
k.t = g
k.y = g
k.q = m
k.o = d
k.v = d
k.z = a
k.w = a
k.x = e
a.v = h
a.r = k
a.q = k
e.t = g
e.o = l
f.p = g
n.z = a
n.y = a
n.p = l
n.v = d
n.q = f
n.o = k
assert f.p.s.v.x.y.r.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: C = None
        self.s: C = None
        self.r: C = None
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: A = None
        self.o: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: C = None
        self.y: G = None
        self.v: A = None
        self.q: I = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: E = None
        self.q: D = None
        self.o: A = None
        self.z: G = None
        self.v: A = None
        self.w: G = None
        self.x: H = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: F = None
        self.q: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

d = A("d")
h = B("h")
l = C("l")
m = D("m")
g = E("g")
k = F("k")
a = G("a")
e = H("e")
f = I("f")
n = C("n")

d.z = a
d.x = l
d.r = l
d.s = n
d.o = e
h.w = e
h.v = d
h.o = g
h.s = m
l.z = a
l.y = a
l.p = n
l.v = d
l.q = f
l.o = k
m.p = e
m.u = d
m.v = d
m.r = f
g.s = h
g.v = h
g.z = m
k.p = f
k.t = g
k.y = g
k.q = m
k.o = d
k.v = d
k.z = a
k.w = a
k.x = e
a.v = h
a.r = k
a.q = k
e.t = g
e.o = l
f.p = g
n.z = a
n.y = a
n.p = l
n.v = d
n.q = f
n.o = k
assert f.p.s.v.x.y.r.z.v.txt == "h"