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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: A = None
        self.o: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: B = None
        self.t: F = None
        self.x: F = None
        self.q: C = None
        self.z: H = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: G = None
        self.x: C = None
        self.o: B = None
        self.w: B = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: A = None
        self.o: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: B = None
        self.t: F = None
        self.x: F = None
        self.q: C = None
        self.z: H = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: G = None
        self.x: C = None
        self.o: B = None
        self.w: B = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

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

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