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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

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