class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: D = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: A = None
        self.q: F = None
        self.y: D = None
        self.s: C = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: A = None
        self.v: C = None
        self.r: B = None
        self.q: A = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: A = None
        self.q: F = None
        self.y: D = None
        self.s: C = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: A = None
        self.v: C = None
        self.r: B = None
        self.q: A = None
        self.w: A = None
        self.txt = txt

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

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