class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.u: G = None
        self.v: F = None
        self.w: E = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: A = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: F = None
        self.v: C = None
        self.w: E = None
        self.p: A = None
        self.x: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: F = None
        self.w: G = None
        self.u: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: A = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: F = None
        self.v: C = None
        self.w: E = None
        self.p: A = None
        self.x: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: F = None
        self.w: G = None
        self.u: C = None
        self.txt = txt

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

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