class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: A = None
        self.s: G = None
        self.z: H = None
        self.o: B = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.u: H = None
        self.p: A = None
        self.s: F = None
        self.t: F = None
        self.o: E = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: A = None
        self.s: G = None
        self.z: H = None
        self.o: B = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.u: H = None
        self.p: A = None
        self.s: F = None
        self.t: F = None
        self.o: E = None
        self.w: F = None
        self.txt = txt

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

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

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