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

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

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

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

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

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

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

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

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