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

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

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

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

e.v = f
b.x = e
b.t = l
a.x = j
a.t = h
h.v = a
g.v = a
k.v = a
j.x = i
j.t = i
i.v = f
l.v = f
f.x = j
f.t = k
assert f.x.t.v.t.v.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

e.v = f
b.x = e
b.t = l
a.x = j
a.t = h
h.v = a
g.v = a
k.v = a
j.x = i
j.t = i
i.v = f
l.v = f
f.x = j
f.t = k
assert f.x.t.v.t.v.x.x.txt == "i"