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

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

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

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

l.t = h
k.p = m
k.o = m
k.x = l
n.s = k
n.u = i
i.t = f
h.s = k
h.u = l
g.s = k
g.u = l
m.s = b
m.u = l
b.p = m
b.o = g
b.x = i
f.s = b
f.u = i
assert i.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

l.t = h
k.p = m
k.o = m
k.x = l
n.s = k
n.u = i
i.t = f
h.s = k
h.u = l
g.s = k
g.u = l
m.s = b
m.u = l
b.p = m
b.o = g
b.x = i
f.s = b
f.u = i
assert i.t.u.t.txt == "f"