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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: A = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
h = C("h")
n = B("n")
l = A("l")
a = B("a")
f = C("f")
j = B("j")

b.t = l
k.o = a
k.t = b
k.p = i
i.p = n
i.v = l
h.p = k
h.v = l
n.o = j
n.t = l
n.p = h
l.t = b
a.o = k
a.t = l
a.p = i
f.p = n
f.v = b
j.o = k
j.t = b
j.p = i
assert f.p.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: A = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
h = C("h")
n = B("n")
l = A("l")
a = B("a")
f = C("f")
j = B("j")

b.t = l
k.o = a
k.t = b
k.p = i
i.p = n
i.v = l
h.p = k
h.v = l
n.o = j
n.t = l
n.p = h
l.t = b
a.o = k
a.t = l
a.p = i
f.p = n
f.v = b
j.o = k
j.t = b
j.p = i
assert f.p.t.t.t.t.t.t.txt == "b"