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

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

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

i = A("i")
j = B("j")
b = C("b")
a = A("a")
f = C("f")
n = A("n")

i.x = f
i.s = j
i.u = b
j.z = n
b.u = f
b.y = j
b.p = j
a.x = f
a.u = f
a.s = j
f.u = b
f.y = j
f.p = j
n.x = f
n.u = f
n.s = j
assert i.s.z.x.y.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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

i = A("i")
j = B("j")
b = C("b")
a = A("a")
f = C("f")
n = A("n")

i.x = f
i.s = j
i.u = b
j.z = n
b.u = f
b.y = j
b.p = j
a.x = f
a.u = f
a.s = j
f.u = b
f.y = j
f.p = j
n.x = f
n.u = f
n.s = j
assert i.s.z.x.y.z.s.txt == "j"