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

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

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

c = A("c")
n = B("n")
j = C("j")
f = C("f")
b = A("b")
i = C("i")
l = B("l")
m = C("m")

c.v = m
c.x = l
n.v = l
n.u = l
n.o = m
j.u = i
f.u = m
b.v = i
b.x = l
i.u = j
l.v = n
l.u = n
l.o = i
m.u = i
assert n.o.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: B = None
        self.txt = txt

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

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

c = A("c")
n = B("n")
j = C("j")
f = C("f")
b = A("b")
i = C("i")
l = B("l")
m = C("m")

c.v = m
c.x = l
n.v = l
n.u = l
n.o = m
j.u = i
f.u = m
b.v = i
b.x = l
i.u = j
l.v = n
l.u = n
l.o = i
m.u = i
assert n.o.u.u.txt == "j"