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

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

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

c = A("c")
b = B("b")
n = C("n")
k = A("k")
h = A("h")
i = C("i")
l = B("l")
f = B("f")
m = B("m")
d = A("d")

c.y = f
b.s = m
b.x = c
b.t = l
n.u = f
k.y = m
h.y = m
i.u = m
l.s = m
l.t = m
l.x = h
f.s = b
f.x = c
f.t = m
m.s = f
m.t = f
m.x = c
d.y = f
assert i.u.s.t.x.y.t.s.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
n = C("n")
k = A("k")
h = A("h")
i = C("i")
l = B("l")
f = B("f")
m = B("m")
d = A("d")

c.y = f
b.s = m
b.x = c
b.t = l
n.u = f
k.y = m
h.y = m
i.u = m
l.s = m
l.t = m
l.x = h
f.s = b
f.x = c
f.t = m
m.s = f
m.t = f
m.x = c
d.y = f
assert i.u.s.t.x.y.t.s.x.y.txt == "f"