class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: G = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: H = None
        self.y: A = None
        self.x: F = None
        self.w: C = None
        self.r: F = None
        self.z: F = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: G = None
        self.t: C = None
        self.q: H = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: B = None
        self.w: A = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: D = None
        self.x: G = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: G = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: H = None
        self.y: A = None
        self.x: F = None
        self.w: C = None
        self.r: F = None
        self.z: F = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: G = None
        self.t: C = None
        self.q: H = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: B = None
        self.w: A = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: D = None
        self.x: G = None
        self.w: E = None
        self.txt = txt

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

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