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

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

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

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

i.p = j
i.y = f
m.x = j
m.z = l
m.s = l
n.t = i
n.y = l
n.v = j
f.p = j
f.y = i
l.x = n
l.z = m
l.s = m
j.t = f
j.y = m
j.v = n
assert i.p.y.x.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: A = None
        self.txt = txt

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

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

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

i.p = j
i.y = f
m.x = j
m.z = l
m.s = l
n.t = i
n.y = l
n.v = j
f.p = j
f.y = i
l.x = n
l.z = m
l.s = m
j.t = f
j.y = m
j.v = n
assert i.p.y.x.v.v.txt == "j"