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

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

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

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

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

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

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

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

a.y = i
a.o = l
i.t = f
i.x = h
j.s = f
j.y = f
j.w = g
h.t = j
h.x = c
c.t = f
c.x = i
f.s = j
f.y = j
f.w = a
l.s = j
l.y = j
l.w = a
g.y = h
g.o = j
assert c.t.y.s.s.y.s.w.txt == "g"