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

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

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

e = A("e")
a = B("a")
n = C("n")
d = B("d")
j = C("j")
i = A("i")
c = B("c")
g = A("g")
l = C("l")

e.x = g
e.o = i
a.q = g
a.w = i
n.w = j
n.v = g
d.q = i
d.w = e
j.w = n
j.v = i
i.x = g
i.o = e
c.q = e
c.w = i
g.x = i
g.o = i
l.w = j
l.v = i
assert c.w.o.o.x.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: A = None
        self.txt = txt

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

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

e = A("e")
a = B("a")
n = C("n")
d = B("d")
j = C("j")
i = A("i")
c = B("c")
g = A("g")
l = C("l")

e.x = g
e.o = i
a.q = g
a.w = i
n.w = j
n.v = g
d.q = i
d.w = e
j.w = n
j.v = i
i.x = g
i.o = e
c.q = e
c.w = i
g.x = i
g.o = i
l.w = j
l.v = i
assert c.w.o.o.x.o.o.o.o.txt == "e"