class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: H = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.p: D = None
        self.z: F = None
        self.y: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.p: D = None
        self.z: F = None
        self.y: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: E = None
        self.txt = txt

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

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