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

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

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

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

l.o = f
l.v = e
n.v = h
n.r = i
n.t = a
i.q = b
k.v = l
k.r = i
k.t = f
e.o = n
e.v = h
a.v = h
a.r = c
a.t = n
f.v = h
f.r = i
f.t = n
h.o = a
h.v = e
c.q = b
b.q = i
assert a.v.v.o.r.q.q.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.txt = txt

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

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

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

l.o = f
l.v = e
n.v = h
n.r = i
n.t = a
i.q = b
k.v = l
k.r = i
k.t = f
e.o = n
e.v = h
a.v = h
a.r = c
a.t = n
f.v = h
f.r = i
f.t = n
h.o = a
h.v = e
c.q = b
b.q = i
assert a.v.v.o.r.q.q.q.q.q.q.txt == "i"