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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: F = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: D = None
        self.v: F = None
        self.s: G = None
        self.z: B = None
        self.r: F = None
        self.x: D = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: G = None
        self.u: H = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: F = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: D = None
        self.v: F = None
        self.s: G = None
        self.z: B = None
        self.r: F = None
        self.x: D = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: G = None
        self.u: H = None
        self.v: C = None
        self.txt = txt

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

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

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

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