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

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

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

l = A("l")
i = B("i")
j = C("j")
d = A("d")
f = C("f")
g = A("g")
n = B("n")
a = A("a")
m = B("m")

l.t = f
l.x = j
i.o = n
j.v = i
d.t = j
d.x = j
f.v = i
g.t = f
g.x = j
n.o = i
a.t = f
a.x = j
m.o = i
assert i.o.o.o.o.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
j = C("j")
d = A("d")
f = C("f")
g = A("g")
n = B("n")
a = A("a")
m = B("m")

l.t = f
l.x = j
i.o = n
j.v = i
d.t = j
d.x = j
f.v = i
g.t = f
g.x = j
n.o = i
a.t = f
a.x = j
m.o = i
assert i.o.o.o.o.o.o.o.o.o.txt == "n"