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

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

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

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

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

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

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

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

k.x = j
k.v = j
k.w = f
g.s = b
g.r = f
g.z = a
n.t = b
n.v = k
n.y = a
c.x = j
c.v = j
c.w = n
j.s = c
j.r = a
j.z = e
a.t = c
a.v = k
a.y = n
m.t = k
m.v = b
m.y = e
b.x = j
b.v = j
b.w = f
f.t = k
f.v = b
f.y = a
e.t = k
e.v = b
e.y = f
assert a.y.y.t.v.z.y.v.w.t.x.txt == "j"