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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.y: F = None
        self.s: I = None
        self.q: I = None
        self.p: C = None
        self.z: D = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: I = None
        self.u: A = None
        self.q: G = None
        self.o: E = None
        self.w: I = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: I = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = 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.p: E = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.y: F = None
        self.s: I = None
        self.q: I = None
        self.p: C = None
        self.z: D = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: I = None
        self.u: A = None
        self.q: G = None
        self.o: E = None
        self.w: I = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: I = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = 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.p: E = None
        self.s: A = None
        self.txt = txt

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

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