class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: H = None
        self.s: E = None
        self.w: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: F = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.y: A = None
        self.o: C = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: G = None
        self.x: B = None
        self.v: H = None
        self.t: A = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: F = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.y: A = None
        self.o: C = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: G = None
        self.x: B = None
        self.v: H = None
        self.t: A = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

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

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