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

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

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

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

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

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

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

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

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