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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.w: C = None
        self.txt = txt

d = A("d")
c = B("c")
n = C("n")
f = C("f")
e = B("e")
i = A("i")
l = A("l")
j = A("j")

d.s = f
c.r = f
c.x = j
c.w = e
n.o = j
n.z = f
n.w = f
f.o = j
f.z = n
f.w = n
e.r = n
e.x = l
e.w = c
i.s = f
l.s = f
j.s = f
assert e.x.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.w: C = None
        self.txt = txt

d = A("d")
c = B("c")
n = C("n")
f = C("f")
e = B("e")
i = A("i")
l = A("l")
j = A("j")

d.s = f
c.r = f
c.x = j
c.w = e
n.o = j
n.z = f
n.w = f
f.o = j
f.z = n
f.w = n
e.r = n
e.x = l
e.w = c
i.s = f
l.s = f
j.s = f
assert e.x.s.w.txt == "n"