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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: E = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: F = None
        self.z: F = None
        self.s: D = None
        self.x: G = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: B = None
        self.x: H = None
        self.q: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: E = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: F = None
        self.z: F = None
        self.s: D = None
        self.x: G = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: B = None
        self.x: H = None
        self.q: A = None
        self.txt = txt

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

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

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