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

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

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

i = A("i")
f = B("f")
c = C("c")
d = B("d")
n = B("n")
e = C("e")
b = B("b")
j = A("j")
h = C("h")
l = B("l")

i.t = e
f.s = h
f.x = j
c.o = d
c.t = e
d.s = e
d.x = j
n.s = h
n.x = j
e.o = n
e.t = h
b.s = c
b.x = i
j.t = h
h.o = b
h.t = e
l.s = e
l.x = j
assert i.t.t.o.s.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
c = C("c")
d = B("d")
n = B("n")
e = C("e")
b = B("b")
j = A("j")
h = C("h")
l = B("l")

i.t = e
f.s = h
f.x = j
c.o = d
c.t = e
d.s = e
d.x = j
n.s = h
n.x = j
e.o = n
e.t = h
b.s = c
b.x = i
j.t = h
h.o = b
h.t = e
l.s = e
l.x = j
assert i.t.t.o.s.t.o.txt == "n"