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

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

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

j = A("j")
m = B("m")
c = C("c")
i = B("i")
e = A("e")
b = C("b")
k = C("k")
g = C("g")
f = C("f")
a = A("a")

j.t = i
j.y = b
j.p = a
m.v = a
m.o = i
m.q = i
c.s = j
i.v = e
i.o = m
i.q = m
e.t = m
e.y = c
e.p = a
b.s = e
k.s = a
g.s = a
f.s = j
a.t = m
a.y = b
a.p = j
assert b.s.y.s.p.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: C = None
        self.p: A = None
        self.txt = txt

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

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

j = A("j")
m = B("m")
c = C("c")
i = B("i")
e = A("e")
b = C("b")
k = C("k")
g = C("g")
f = C("f")
a = A("a")

j.t = i
j.y = b
j.p = a
m.v = a
m.o = i
m.q = i
c.s = j
i.v = e
i.o = m
i.q = m
e.t = m
e.y = c
e.p = a
b.s = e
k.s = a
g.s = a
f.s = j
a.t = m
a.y = b
a.p = j
assert b.s.y.s.p.y.s.txt == "e"