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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.v: H = None
        self.t: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.o: G = None
        self.w: E = None
        self.v: C = None
        self.t: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.v: H = None
        self.t: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.o: G = None
        self.w: E = None
        self.v: C = None
        self.t: C = None
        self.txt = txt

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

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