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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: E = None
        self.p: I = None
        self.q: I = None
        self.o: C = None
        self.z: C = None
        self.u: G = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: A = None
        self.r: G = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: H = None
        self.y: B = None
        self.o: D = None
        self.q: D = None
        self.s: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: E = None
        self.p: I = None
        self.q: I = None
        self.o: C = None
        self.z: C = None
        self.u: G = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: A = None
        self.r: G = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: H = None
        self.y: B = None
        self.o: D = None
        self.q: D = None
        self.s: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

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