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

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

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

n = A("n")
e = B("e")
c = C("c")
i = B("i")
b = B("b")
f = C("f")

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

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

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

n = A("n")
e = B("e")
c = C("c")
i = B("i")
b = B("b")
f = C("f")

n.u = f
n.o = b
e.w = n
e.t = n
c.u = f
c.y = f
i.w = n
i.t = n
b.w = n
b.t = n
f.u = c
f.y = c
assert n.u.y.y.u.y.u.txt == "c"