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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.o: F = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.o: B = None
        self.v: F = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.o: F = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.o: B = None
        self.v: F = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

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