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

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

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

f = A("f")
a = B("a")
i = C("i")
j = A("j")
h = A("h")
c = A("c")
l = C("l")
b = A("b")
k = B("k")

f.o = b
f.w = j
f.s = k
a.o = f
a.t = l
a.u = c
i.o = h
i.u = c
j.o = f
j.w = f
j.s = a
h.o = j
h.w = c
h.s = k
c.o = f
c.w = b
c.s = k
l.o = h
l.u = c
b.o = c
b.w = c
b.s = k
k.o = b
k.u = b
k.t = i
assert b.w.w.s.u.w.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

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

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

f = A("f")
a = B("a")
i = C("i")
j = A("j")
h = A("h")
c = A("c")
l = C("l")
b = A("b")
k = B("k")

f.o = b
f.w = j
f.s = k
a.o = f
a.t = l
a.u = c
i.o = h
i.u = c
j.o = f
j.w = f
j.s = a
h.o = j
h.w = c
h.s = k
c.o = f
c.w = b
c.s = k
l.o = h
l.u = c
b.o = c
b.w = c
b.s = k
k.o = b
k.u = b
k.t = i
assert b.w.w.s.u.w.o.s.o.txt == "b"