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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: D = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.txt = txt

c = A("c")
d = B("d")
n = C("n")
b = D("b")
f = E("f")
e = D("e")
l = A("l")
g = B("g")
j = B("j")
k = C("k")

c.y = l
c.t = l
c.p = k
d.r = f
d.v = f
d.q = e
n.p = k
n.t = b
n.s = b
n.r = b
b.p = n
f.t = n
f.q = n
e.p = k
l.y = c
l.t = c
l.p = k
g.r = f
g.v = f
g.q = b
j.r = f
j.v = f
j.q = b
k.p = n
k.t = e
k.s = e
k.r = e
assert c.y.p.p.s.p.s.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: C = None
        self.t: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: D = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.txt = txt

c = A("c")
d = B("d")
n = C("n")
b = D("b")
f = E("f")
e = D("e")
l = A("l")
g = B("g")
j = B("j")
k = C("k")

c.y = l
c.t = l
c.p = k
d.r = f
d.v = f
d.q = e
n.p = k
n.t = b
n.s = b
n.r = b
b.p = n
f.t = n
f.q = n
e.p = k
l.y = c
l.t = c
l.p = k
g.r = f
g.v = f
g.q = b
j.r = f
j.v = f
j.q = b
k.p = n
k.t = e
k.s = e
k.r = e
assert c.y.p.p.s.p.s.p.s.p.txt == "n"