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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: H = None
        self.y: C = None
        self.q: A = None
        self.x: G = None
        self.s: B = None
        self.w: B = None
        self.o: A = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: H = None
        self.y: C = None
        self.q: A = None
        self.x: G = None
        self.s: B = None
        self.w: B = None
        self.o: A = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: H = None
        self.txt = txt

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

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