class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

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

b.o = g
k.z = l
e.o = n
e.x = a
m.r = n
g.z = n
g.q = b
g.u = l
j.p = g
j.t = e
j.q = k
j.x = b
j.s = n
l.s = a
l.r = n
l.x = k
l.u = k
l.o = g
l.q = b
l.p = b
l.t = m
a.x = b
a.t = j
a.u = e
a.r = g
n.r = m
assert k.z.r.r.r.r.r.r.r.txt == "n"