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

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

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

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

e.p = f
e.x = k
e.q = m
f.z = e
f.v = m
f.w = j
l.y = e
l.o = n
c.y = k
c.o = k
m.z = k
m.v = f
m.w = f
j.z = e
j.v = f
j.w = f
k.p = m
k.x = e
k.q = j
n.p = j
n.q = j
n.x = e
assert c.y.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.q: B = None
        self.txt = txt

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

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

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

e.p = f
e.x = k
e.q = m
f.z = e
f.v = m
f.w = j
l.y = e
l.o = n
c.y = k
c.o = k
m.z = k
m.v = f
m.w = f
j.z = e
j.v = f
j.w = f
k.p = m
k.x = e
k.q = j
n.p = j
n.q = j
n.x = e
assert c.y.p.w.txt == "f"