class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: H = None
        self.w: C = None
        self.q: F = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: H = None
        self.q: A = None
        self.y: D = None
        self.t: A = None
        self.x: I = None
        self.o: I = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: H = None
        self.q: A = None
        self.y: D = None
        self.t: A = None
        self.x: I = None
        self.o: I = None
        self.txt = txt

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

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

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

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

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

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