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

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

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

l = A("l")
f = B("f")
k = C("k")
d = B("d")
a = A("a")
j = C("j")
i = A("i")

l.o = k
l.y = k
l.p = k
f.v = i
f.p = i
k.t = i
d.v = a
d.p = a
a.o = j
a.p = j
a.y = k
j.t = a
i.o = k
i.p = k
i.y = j
assert f.v.y.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.p: C = None
        self.txt = txt

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

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

l = A("l")
f = B("f")
k = C("k")
d = B("d")
a = A("a")
j = C("j")
i = A("i")

l.o = k
l.y = k
l.p = k
f.v = i
f.p = i
k.t = i
d.v = a
d.p = a
a.o = j
a.p = j
a.y = k
j.t = a
i.o = k
i.p = k
i.y = j
assert f.v.y.t.y.t.txt == "i"