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

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

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

i = A("i")
f = B("f")
l = C("l")
k = B("k")
g = B("g")
j = A("j")
e = B("e")
c = C("c")

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

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

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

i = A("i")
f = B("f")
l = C("l")
k = B("k")
g = B("g")
j = A("j")
e = B("e")
c = C("c")

i.y = j
i.v = k
i.t = c
f.x = e
l.t = i
l.y = j
k.x = e
g.x = f
j.y = i
j.v = k
j.t = l
e.x = g
c.t = i
c.y = j
assert k.x.x.x.x.x.txt == "g"