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

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

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

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

i.r = c
d.w = n
d.o = n
j.u = f
j.s = i
j.o = c
f.u = e
f.s = c
f.o = n
c.r = i
l.w = i
l.o = i
m.w = n
m.o = i
e.u = j
e.s = c
e.o = i
n.r = c
assert l.o.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

i.r = c
d.w = n
d.o = n
j.u = f
j.s = i
j.o = c
f.u = e
f.s = c
f.o = n
c.r = i
l.w = i
l.o = i
m.w = n
m.o = i
e.u = j
e.s = c
e.o = i
n.r = c
assert l.o.r.r.r.r.txt == "i"