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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.z: E = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: H = None
        self.z: A = None
        self.v: E = None
        self.t: I = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.z: E = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: H = None
        self.z: A = None
        self.v: E = None
        self.t: I = None
        self.txt = txt

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

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

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

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

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