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

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

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

c = A("c")
k = B("k")
a = C("a")
f = A("f")
e = B("e")
l = C("l")
i = A("i")
n = B("n")

c.w = i
c.u = k
k.o = c
a.y = f
a.u = f
f.w = i
f.u = e
e.o = c
l.y = f
l.u = i
i.w = f
i.u = n
n.o = f
assert i.w.u.o.w.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: B = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
a = C("a")
f = A("f")
e = B("e")
l = C("l")
i = A("i")
n = B("n")

c.w = i
c.u = k
k.o = c
a.y = f
a.u = f
f.w = i
f.u = e
e.o = c
l.y = f
l.u = i
i.w = f
i.u = n
n.o = f
assert i.w.u.o.w.u.o.txt == "f"