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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: H = None
        self.p: D = None
        self.v: H = None
        self.u: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.r: F = None
        self.z: E = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.r: B = None
        self.q: C = None
        self.z: E = None
        self.u: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: H = None
        self.p: D = None
        self.v: H = None
        self.u: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.r: F = None
        self.z: E = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.r: B = None
        self.q: C = None
        self.z: E = None
        self.u: A = None
        self.p: E = None
        self.txt = txt

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

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

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