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

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

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

c = A("c")
k = B("k")
h = C("h")
f = A("f")
i = B("i")
d = C("d")
a = A("a")
b = C("b")

c.w = i
c.y = b
k.z = f
k.p = f
h.v = f
h.z = i
h.s = b
f.w = k
f.y = d
i.z = a
i.p = a
d.v = c
d.z = i
d.s = h
a.w = i
a.y = d
b.v = a
b.z = k
b.s = d
assert d.z.p.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
h = C("h")
f = A("f")
i = B("i")
d = C("d")
a = A("a")
b = C("b")

c.w = i
c.y = b
k.z = f
k.p = f
h.v = f
h.z = i
h.s = b
f.w = k
f.y = d
i.z = a
i.p = a
d.v = c
d.z = i
d.s = h
a.w = i
a.y = d
b.v = a
b.z = k
b.s = d
assert d.z.p.y.v.txt == "c"