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

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

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

n = A("n")
l = B("l")
j = C("j")
m = C("m")
f = A("f")
g = B("g")
c = C("c")
a = C("a")
i = B("i")
k = B("k")

n.y = f
n.q = f
n.o = c
l.x = f
j.w = n
j.u = l
m.w = f
m.u = l
f.y = n
f.q = n
f.o = m
g.x = f
c.w = n
c.u = i
a.w = f
a.u = k
i.x = f
k.x = f
assert l.x.q.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: A = None
        self.o: C = None
        self.txt = txt

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

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

n = A("n")
l = B("l")
j = C("j")
m = C("m")
f = A("f")
g = B("g")
c = C("c")
a = C("a")
i = B("i")
k = B("k")

n.y = f
n.q = f
n.o = c
l.x = f
j.w = n
j.u = l
m.w = f
m.u = l
f.y = n
f.q = n
f.o = m
g.x = f
c.w = n
c.u = i
a.w = f
a.u = k
i.x = f
k.x = f
assert l.x.q.o.u.txt == "i"