class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: E = None
        self.u: G = None
        self.t: E = None
        self.s: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: H = None
        self.r: F = None
        self.s: B = None
        self.o: I = None
        self.t: C = None
        self.p: H = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: E = None
        self.u: G = None
        self.t: E = None
        self.s: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: H = None
        self.r: F = None
        self.s: B = None
        self.o: I = None
        self.t: C = None
        self.p: H = None
        self.w: E = None
        self.txt = txt

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

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

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

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