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

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

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

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

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

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

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

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

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

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

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

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

l.w = k
l.u = n
l.v = n
l.p = b
l.x = e
h.t = d
h.w = b
f.w = b
a.u = e
a.s = e
a.p = h
a.z = d
e.z = l
e.p = h
e.s = a
e.u = n
g.u = e
g.s = e
g.p = h
g.z = f
d.w = l
k.t = f
k.w = l
b.w = k
b.v = k
b.u = n
b.p = l
b.x = e
n.t = f
n.w = b
assert n.w.p.x.p.w.x.s.p.w.p.txt == "l"