class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.q: C = None
        self.o: G = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.z: D = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.z: D = None
        self.s: A = None
        self.txt = txt

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

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