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

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

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

l = A("l")
e = B("e")
a = C("a")
m = C("m")
f = B("f")
b = A("b")
j = A("j")
c = C("c")
n = B("n")

l.s = m
l.y = j
l.x = n
e.o = f
e.t = f
a.z = e
m.z = n
f.o = n
f.t = n
b.s = m
b.y = j
b.x = n
j.s = m
j.y = l
j.x = f
c.z = n
n.o = f
n.t = f
assert j.x.t.t.t.t.t.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.x: B = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
a = C("a")
m = C("m")
f = B("f")
b = A("b")
j = A("j")
c = C("c")
n = B("n")

l.s = m
l.y = j
l.x = n
e.o = f
e.t = f
a.z = e
m.z = n
f.o = n
f.t = n
b.s = m
b.y = j
b.x = n
j.s = m
j.y = l
j.x = f
c.z = n
n.o = f
n.t = f
assert j.x.t.t.t.t.t.o.o.txt == "n"