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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: H = None
        self.x: B = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: A = None
        self.o: D = None
        self.v: F = None
        self.q: D = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: H = None
        self.w: C = None
        self.r: E = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: D = None
        self.w: E = None
        self.t: F = None
        self.y: B = None
        self.s: B = None
        self.q: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: H = None
        self.x: B = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: A = None
        self.o: D = None
        self.v: F = None
        self.q: D = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: H = None
        self.w: C = None
        self.r: E = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: D = None
        self.w: E = None
        self.t: F = None
        self.y: B = None
        self.s: B = None
        self.q: D = None
        self.txt = txt

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

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