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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: E = None
        self.r: E = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: E = None
        self.z: B = None
        self.u: C = None
        self.p: H = None
        self.q: G = None
        self.t: G = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: F = None
        self.v: A = None
        self.t: A = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: E = None
        self.r: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: E = None
        self.r: E = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: E = None
        self.z: B = None
        self.u: C = None
        self.p: H = None
        self.q: G = None
        self.t: G = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: F = None
        self.v: A = None
        self.t: A = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: E = None
        self.r: B = None
        self.x: B = None
        self.txt = txt

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

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