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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: E = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.w: C = None
        self.s: E = None
        self.z: H = None
        self.x: D = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: G = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: G = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: E = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.w: C = None
        self.s: E = None
        self.z: H = None
        self.x: D = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: G = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: G = None
        self.o: B = None
        self.txt = txt

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

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