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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: I = None
        self.y: G = None
        self.q: H = None
        self.t: A = None
        self.r: H = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: E = None
        self.o: E = None
        self.p: A = None
        self.u: A = None
        self.w: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: I = None
        self.y: G = None
        self.q: H = None
        self.t: A = None
        self.r: H = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: E = None
        self.o: E = None
        self.p: A = None
        self.u: A = None
        self.w: G = None
        self.r: G = None
        self.txt = txt

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

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

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