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

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

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

e = A("e")
d = B("d")
b = C("b")
k = C("k")
f = B("f")
c = B("c")
a = A("a")
h = B("h")

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

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

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

e = A("e")
d = B("d")
b = C("b")
k = C("k")
f = B("f")
c = B("c")
a = A("a")
h = B("h")

e.s = b
e.r = b
e.y = b
d.o = k
b.o = k
b.t = k
b.r = k
k.o = b
k.t = b
k.r = b
f.o = b
c.o = k
a.s = b
a.r = b
a.y = k
h.o = b
assert b.t.o.t.r.r.t.t.txt == "k"