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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: I = None
        self.z: G = None
        self.t: E = None
        self.s: B = None
        self.q: H = None
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: I = None
        self.z: G = None
        self.t: E = None
        self.s: B = None
        self.q: H = None
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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