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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

d = A("d")
l = B("l")
h = C("h")
e = A("e")
j = B("j")
a = A("a")
c = C("c")
i = C("i")

d.o = h
d.y = h
d.s = i
l.r = h
l.u = c
h.p = d
h.v = c
e.o = i
e.y = h
e.s = c
j.r = i
j.u = i
a.o = c
a.s = c
a.y = i
c.p = d
c.v = h
i.p = a
i.v = c
assert i.v.v.v.p.y.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

d = A("d")
l = B("l")
h = C("h")
e = A("e")
j = B("j")
a = A("a")
c = C("c")
i = C("i")

d.o = h
d.y = h
d.s = i
l.r = h
l.u = c
h.p = d
h.v = c
e.o = i
e.y = h
e.s = c
j.r = i
j.u = i
a.o = c
a.s = c
a.y = i
c.p = d
c.v = h
i.p = a
i.v = c
assert i.v.v.v.p.y.p.s.p.txt == "a"