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

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

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

f = A("f")
b = B("b")
i = C("i")
g = B("g")
d = C("d")
c = C("c")
a = C("a")
e = B("e")

f.s = c
f.t = e
f.r = d
b.t = f
i.w = c
i.y = c
i.o = a
g.t = f
d.w = i
d.o = a
d.y = a
c.w = i
c.y = i
c.o = d
a.w = i
a.y = i
a.o = c
e.t = f
assert f.r.y.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: B = None
        self.r: C = None
        self.txt = txt

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

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

f = A("f")
b = B("b")
i = C("i")
g = B("g")
d = C("d")
c = C("c")
a = C("a")
e = B("e")

f.s = c
f.t = e
f.r = d
b.t = f
i.w = c
i.y = c
i.o = a
g.t = f
d.w = i
d.o = a
d.y = a
c.w = i
c.y = i
c.o = d
a.w = i
a.y = i
a.o = c
e.t = f
assert f.r.y.o.w.txt == "i"