class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: H = None
        self.w: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: D = None
        self.s: D = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.x: A = None
        self.w: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: D = None
        self.s: D = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.x: A = None
        self.w: E = None
        self.t: D = None
        self.txt = txt

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

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