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

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

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

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

a.t = i
a.y = f
l.u = a
l.v = e
j.p = a
j.r = a
j.o = f
f.u = a
f.v = i
e.p = a
e.r = a
e.o = f
b.p = a
b.r = a
b.o = l
i.p = a
i.r = a
i.o = f
assert e.o.u.t.p.y.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: B = None
        self.txt = txt

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

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

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

a.t = i
a.y = f
l.u = a
l.v = e
j.p = a
j.r = a
j.o = f
f.u = a
f.v = i
e.p = a
e.r = a
e.o = f
b.p = a
b.r = a
b.o = l
i.p = a
i.r = a
i.o = f
assert e.o.u.t.p.y.v.o.txt == "f"