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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: F = None
        self.y: B = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.r: E = None
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: F = None
        self.y: B = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.r: E = None
        self.t: A = None
        self.txt = txt

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

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