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

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

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

b = A("b")
a = B("a")
g = C("g")
k = C("k")
e = B("e")
j = B("j")
n = B("n")
l = C("l")

b.r = k
a.v = e
a.q = l
a.y = b
g.u = n
g.z = a
g.t = b
k.u = n
k.z = n
k.t = b
e.v = j
e.q = k
e.y = b
j.v = a
j.q = k
j.y = b
n.v = e
n.q = l
n.y = b
l.u = j
l.z = n
l.t = b
assert k.z.q.u.v.y.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

b = A("b")
a = B("a")
g = C("g")
k = C("k")
e = B("e")
j = B("j")
n = B("n")
l = C("l")

b.r = k
a.v = e
a.q = l
a.y = b
g.u = n
g.z = a
g.t = b
k.u = n
k.z = n
k.t = b
e.v = j
e.q = k
e.y = b
j.v = a
j.q = k
j.y = b
n.v = e
n.q = l
n.y = b
l.u = j
l.z = n
l.t = b
assert k.z.q.u.v.y.r.z.txt == "n"