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

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

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

f = A("f")
j = B("j")
m = C("m")
k = C("k")
b = B("b")

f.x = m
f.o = m
f.s = j
j.r = b
m.u = b
k.u = b
b.r = j
assert b.r.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.o: C = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
m = C("m")
k = C("k")
b = B("b")

f.x = m
f.o = m
f.s = j
j.r = b
m.u = b
k.u = b
b.r = j
assert b.r.r.r.r.r.txt == "j"