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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.q: A = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.o: G = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: B = None
        self.w: H = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: D = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.q: A = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.o: G = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: B = None
        self.w: H = None
        self.t: A = None
        self.txt = txt

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

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

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