class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: F = None
        self.u: E = None
        self.q: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: E = None
        self.o: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: E = None
        self.o: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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