class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: C = None
        self.z: G = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: G = None
        self.x: F = None
        self.y: H = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.x: F = None
        self.o: A = None
        self.v: C = None
        self.z: H = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: H = None
        self.y: H = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: G = None
        self.x: F = None
        self.y: H = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.x: F = None
        self.o: A = None
        self.v: C = None
        self.z: H = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: H = None
        self.y: H = None
        self.r: F = None
        self.txt = txt

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

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

g.o = m
g.t = n
g.z = c
g.r = i
m.t = g
m.z = a
n.z = k
n.u = c
n.x = h
n.y = a
n.o = g
i.r = g
k.t = g
k.u = g
k.o = g
k.x = h
k.v = n
k.z = a
k.r = m
h.r = g
h.u = g
h.y = i
c.v = g
c.s = a
c.y = a
c.r = h
a.u = c
a.s = c
a.t = g
a.v = g
a.x = g
a.q = m
a.o = h
a.r = h
assert a.q.z.o.y.r.txt == "g"