class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: D = None
        self.v: B = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: E = None
        self.txt = txt

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

c.x = m
c.r = e
c.v = k
c.t = l
c.z = n
d.o = g
d.t = g
d.x = m
d.v = k
l.y = d
l.u = n
l.r = e
e.s = l
m.s = f
m.p = f
n.y = d
n.u = l
n.r = e
f.s = m
f.p = m
k.o = c
k.x = f
k.v = d
k.t = g
g.x = m
g.r = e
g.v = d
g.t = n
g.z = l
j.o = c
j.x = m
j.v = k
j.t = g
assert l.y.x.s.s.s.s.s.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: D = None
        self.v: B = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: E = None
        self.txt = txt

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

c.x = m
c.r = e
c.v = k
c.t = l
c.z = n
d.o = g
d.t = g
d.x = m
d.v = k
l.y = d
l.u = n
l.r = e
e.s = l
m.s = f
m.p = f
n.y = d
n.u = l
n.r = e
f.s = m
f.p = m
k.o = c
k.x = f
k.v = d
k.t = g
g.x = m
g.r = e
g.v = d
g.t = n
g.z = l
j.o = c
j.x = m
j.v = k
j.t = g
assert l.y.x.s.s.s.s.s.p.s.p.txt == "m"