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

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

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

n = A("n")
b = B("b")
k = C("k")
h = C("h")
l = B("l")
j = A("j")
f = C("f")

n.o = j
n.s = j
n.t = b
b.r = n
k.z = h
k.t = l
k.u = l
h.z = f
h.t = l
h.u = l
l.r = j
j.o = n
j.s = n
j.t = l
f.z = k
f.t = b
f.u = b
assert j.o.t.r.t.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.s: A = None
        self.txt = txt

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

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

n = A("n")
b = B("b")
k = C("k")
h = C("h")
l = B("l")
j = A("j")
f = C("f")

n.o = j
n.s = j
n.t = b
b.r = n
k.z = h
k.t = l
k.u = l
h.z = f
h.t = l
h.u = l
l.r = j
j.o = n
j.s = n
j.t = l
f.z = k
f.t = b
f.u = b
assert j.o.t.r.t.r.t.txt == "b"