class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.r: G = None
        self.z: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: H = None
        self.q: E = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: G = None
        self.o: H = None
        self.v: D = None
        self.q: A = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: H = None
        self.q: E = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: G = None
        self.o: H = None
        self.v: D = None
        self.q: A = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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