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

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

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

i = A("i")
j = B("j")
c = C("c")
l = C("l")
a = A("a")
d = B("d")
m = C("m")

i.o = m
j.w = d
j.u = c
c.t = a
c.w = m
c.x = d
l.t = i
l.w = c
l.x = j
a.o = l
d.w = j
d.u = l
m.t = a
m.w = l
m.x = d
assert j.w.w.w.w.w.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

i = A("i")
j = B("j")
c = C("c")
l = C("l")
a = A("a")
d = B("d")
m = C("m")

i.o = m
j.w = d
j.u = c
c.t = a
c.w = m
c.x = d
l.t = i
l.w = c
l.x = j
a.o = l
d.w = j
d.u = l
m.t = a
m.w = l
m.x = d
assert j.w.w.w.w.w.u.t.txt == "i"