class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: A = None
        self.o: B = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.p: A = None
        self.u: C = None
        self.y: C = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: A = None
        self.o: B = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.p: A = None
        self.u: C = None
        self.y: C = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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