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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.p: A = None
        self.t: A = None
        self.s: A = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.p: A = None
        self.t: A = None
        self.s: A = None
        self.x: F = None
        self.txt = txt

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

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