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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: E = None
        self.p: D = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

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

b.s = a
b.r = d
a.z = k
a.s = f
a.w = c
n.w = e
n.r = e
d.w = f
d.v = k
d.x = n
d.r = l
d.q = l
f.u = c
f.x = k
f.p = d
f.s = d
f.w = a
e.w = n
e.r = n
c.s = a
c.r = d
k.u = b
k.x = f
k.p = d
k.s = d
k.w = a
l.s = a
l.r = d
assert l.s.w.r.w.s.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: E = None
        self.p: D = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

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

b.s = a
b.r = d
a.z = k
a.s = f
a.w = c
n.w = e
n.r = e
d.w = f
d.v = k
d.x = n
d.r = l
d.q = l
f.u = c
f.x = k
f.p = d
f.s = d
f.w = a
e.w = n
e.r = n
c.s = a
c.r = d
k.u = b
k.x = f
k.p = d
k.s = d
k.w = a
l.s = a
l.r = d
assert l.s.w.r.w.s.x.w.txt == "e"