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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: H = None
        self.z: B = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: H = None
        self.z: B = None
        self.u: F = None
        self.txt = txt

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

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

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