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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: H = None
        self.r: D = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: F = None
        self.txt = txt

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

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

i.t = c
c.z = i
d.o = k
a.v = b
a.z = i
n.o = a
k.o = l
l.v = k
l.x = b
l.o = b
l.r = a
b.u = l
b.y = k
h.q = l
h.s = a
h.r = n
h.p = b
assert c.z.t.z.t.z.t.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: H = None
        self.r: D = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: F = None
        self.txt = txt

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

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

i.t = c
c.z = i
d.o = k
a.v = b
a.z = i
n.o = a
k.o = l
l.v = k
l.x = b
l.o = b
l.r = a
b.u = l
b.y = k
h.q = l
h.s = a
h.r = n
h.p = b
assert c.z.t.z.t.z.t.z.t.txt == "c"