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

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

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

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

c.u = g
c.s = a
k.q = i
k.s = g
l.s = g
l.z = k
l.v = f
a.u = g
a.s = g
f.q = k
f.s = a
j.s = a
j.z = k
j.v = k
g.u = a
g.s = c
i.q = k
i.s = c
assert j.s.s.s.s.s.u.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

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

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

c.u = g
c.s = a
k.q = i
k.s = g
l.s = g
l.z = k
l.v = f
a.u = g
a.s = g
f.q = k
f.s = a
j.s = a
j.z = k
j.v = k
g.u = a
g.s = c
i.q = k
i.s = c
assert j.s.s.s.s.s.u.s.u.txt == "a"