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

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

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

m = A("m")
i = B("i")
j = C("j")
l = C("l")

m.r = i
m.x = i
m.o = i
i.u = j
i.p = l
j.v = i
j.y = l
l.v = i
l.y = j
assert j.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.o: B = None
        self.txt = txt

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

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

m = A("m")
i = B("i")
j = C("j")
l = C("l")

m.r = i
m.x = i
m.o = i
i.u = j
i.p = l
j.v = i
j.y = l
l.v = i
l.y = j
assert j.y.y.y.y.txt == "j"