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

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

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

m = A("m")
c = B("c")
e = C("e")
f = C("f")
l = B("l")
j = B("j")
k = C("k")

m.v = f
m.t = e
c.p = m
e.s = f
e.q = f
e.x = k
f.s = e
f.x = e
f.q = k
l.p = m
j.p = m
k.s = f
k.x = e
k.q = e
assert m.v.q.q.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.txt = txt

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

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

m = A("m")
c = B("c")
e = C("e")
f = C("f")
l = B("l")
j = B("j")
k = C("k")

m.v = f
m.t = e
c.p = m
e.s = f
e.q = f
e.x = k
f.s = e
f.x = e
f.q = k
l.p = m
j.p = m
k.s = f
k.x = e
k.q = e
assert m.v.q.q.x.x.x.x.txt == "e"