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

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

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

g = A("g")
e = B("e")
f = C("f")
b = A("b")
d = A("d")
k = C("k")
j = A("j")
m = B("m")
a = C("a")
c = C("c")

g.w = c
e.u = m
e.s = g
f.x = c
f.o = e
b.w = a
d.w = a
k.x = f
k.o = e
j.w = f
m.u = e
m.s = b
a.x = f
a.o = e
c.x = k
c.o = e
assert j.w.x.o.u.u.s.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
f = C("f")
b = A("b")
d = A("d")
k = C("k")
j = A("j")
m = B("m")
a = C("a")
c = C("c")

g.w = c
e.u = m
e.s = g
f.x = c
f.o = e
b.w = a
d.w = a
k.x = f
k.o = e
j.w = f
m.u = e
m.s = b
a.x = f
a.o = e
c.x = k
c.o = e
assert j.w.x.o.u.u.s.w.x.txt == "k"