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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.y: H = None
        self.p: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: H = None
        self.q: A = None
        self.x: C = None
        self.s: H = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.r: D = None
        self.u: F = None
        self.z: A = None
        self.v: B = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: B = None
        self.z: G = None
        self.w: G = None
        self.v: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.y: H = None
        self.p: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: H = None
        self.q: A = None
        self.x: C = None
        self.s: H = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.r: D = None
        self.u: F = None
        self.z: A = None
        self.v: B = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: B = None
        self.z: G = None
        self.w: G = None
        self.v: C = None
        self.txt = txt

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

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