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

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

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

k = A("k")
a = B("a")
c = C("c")
e = A("e")
n = A("n")
l = C("l")
h = A("h")
f = C("f")
d = B("d")
i = B("i")

k.y = c
k.w = e
k.o = l
a.w = d
a.t = d
a.p = c
c.t = i
c.p = k
c.z = k
e.y = l
e.w = n
e.o = f
n.y = l
n.w = e
n.o = f
l.t = i
l.p = h
l.z = k
h.y = l
h.w = e
h.o = c
f.t = d
f.p = k
f.z = k
d.w = i
d.t = a
d.p = f
i.w = d
i.t = a
i.p = l
assert c.t.p.z.w.w.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
c = C("c")
e = A("e")
n = A("n")
l = C("l")
h = A("h")
f = C("f")
d = B("d")
i = B("i")

k.y = c
k.w = e
k.o = l
a.w = d
a.t = d
a.p = c
c.t = i
c.p = k
c.z = k
e.y = l
e.w = n
e.o = f
n.y = l
n.w = e
n.o = f
l.t = i
l.p = h
l.z = k
h.y = l
h.w = e
h.o = c
f.t = d
f.p = k
f.z = k
d.w = i
d.t = a
d.p = f
i.w = d
i.t = a
i.p = l
assert c.t.p.z.w.w.w.o.txt == "f"