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

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

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

m = A("m")
j = B("j")
d = C("d")
b = A("b")
c = B("c")
h = A("h")
f = B("f")
n = A("n")
e = A("e")
k = C("k")

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

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

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

m = A("m")
j = B("j")
d = C("d")
b = A("b")
c = B("c")
h = A("h")
f = B("f")
n = A("n")
e = A("e")
k = C("k")

m.o = e
m.s = k
m.u = b
j.r = d
d.y = j
d.s = m
b.o = m
b.s = d
b.u = h
c.r = k
h.o = m
h.u = m
h.s = d
f.r = k
n.o = b
n.s = d
n.u = h
e.o = h
e.s = k
e.u = m
k.y = j
k.s = m
assert f.r.s.s.s.s.y.r.y.txt == "j"