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

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

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

l = A("l")
g = B("g")
f = C("f")
i = A("i")
k = B("k")
e = C("e")
j = B("j")
b = A("b")

l.u = f
l.y = i
g.o = e
g.v = e
g.q = j
f.u = e
i.u = e
i.y = b
k.o = e
k.v = e
k.q = j
e.u = f
j.o = f
j.v = e
j.q = k
b.u = f
b.y = i
assert e.u.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: A = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
f = C("f")
i = A("i")
k = B("k")
e = C("e")
j = B("j")
b = A("b")

l.u = f
l.y = i
g.o = e
g.v = e
g.q = j
f.u = e
i.u = e
i.y = b
k.o = e
k.v = e
k.q = j
e.u = f
j.o = f
j.v = e
j.q = k
b.u = f
b.y = i
assert e.u.u.u.u.u.u.txt == "e"