class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: I = None
        self.y: D = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: H = None
        self.t: A = None
        self.y: D = None
        self.o: I = None
        self.w: C = None
        self.x: A = None
        self.u: F = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: G = None
        self.v: F = None
        self.q: D = None
        self.y: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: I = None
        self.y: D = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: H = None
        self.t: A = None
        self.y: D = None
        self.o: I = None
        self.w: C = None
        self.x: A = None
        self.u: F = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: G = None
        self.v: F = None
        self.q: D = None
        self.y: F = None
        self.txt = txt

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

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

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