class A:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: B = None
        self.o: G = None
        self.z: A = None
        self.s: A = None
        self.q: A = None
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.p: B = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.y: B = None
        self.s: D = None
        self.v: G = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: F = None
        self.w: F = None
        self.q: C = None
        self.y: A = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: D = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: B = None
        self.o: G = None
        self.z: A = None
        self.s: A = None
        self.q: A = None
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.p: B = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.y: B = None
        self.s: D = None
        self.v: G = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: F = None
        self.w: F = None
        self.q: C = None
        self.y: A = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: D = None
        self.z: G = None
        self.txt = txt

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

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