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

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

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

j = A("j")
k = B("k")
e = C("e")
n = B("n")
f = C("f")
a = A("a")

j.x = e
j.s = e
j.q = n
k.q = e
k.z = e
k.x = f
e.w = a
e.t = f
n.q = f
n.x = f
n.z = f
f.w = j
f.t = e
a.x = e
a.s = f
a.q = n
assert k.x.w.q.z.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: C = None
        self.q: B = None
        self.txt = txt

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

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

j = A("j")
k = B("k")
e = C("e")
n = B("n")
f = C("f")
a = A("a")

j.x = e
j.s = e
j.q = n
k.q = e
k.z = e
k.x = f
e.w = a
e.t = f
n.q = f
n.x = f
n.z = f
f.w = j
f.t = e
a.x = e
a.s = f
a.q = n
assert k.x.w.q.z.w.x.txt == "e"