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

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

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

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

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

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

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

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

b.x = j
b.v = g
b.z = k
k.t = n
k.y = m
j.v = e
j.q = c
j.z = b
c.x = n
c.v = e
c.z = m
n.v = g
n.q = c
n.z = c
e.x = j
e.v = c
e.z = m
m.t = j
m.y = k
a.v = g
a.q = c
a.z = b
g.x = j
g.v = e
g.z = m
assert g.z.y.t.v.x.txt == "j"