class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: B = None
        self.s: F = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: F = None
        self.s: H = None
        self.u: A = None
        self.v: G = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: F = None
        self.s: H = None
        self.u: A = None
        self.v: G = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

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