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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.q: G = None
        self.w: I = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: A = None
        self.w: C = None
        self.r: G = None
        self.o: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.q: G = None
        self.w: I = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: A = None
        self.w: C = None
        self.r: G = None
        self.o: G = None
        self.txt = txt

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

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

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