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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: B = None
        self.s: D = None
        self.z: D = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: C = None
        self.y: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: B = None
        self.s: D = None
        self.z: D = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: C = None
        self.y: C = None
        self.txt = txt

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

n.u = l
n.w = l
m.s = k
m.p = k
m.w = d
d.p = l
d.s = l
d.q = m
d.z = h
d.v = n
h.w = l
h.r = l
h.x = d
h.z = d
h.u = k
a.w = f
a.z = d
a.y = d
f.w = a
f.z = d
f.y = d
k.s = m
k.p = m
k.w = d
l.w = h
l.r = h
l.x = d
l.z = d
l.u = m
assert f.w.w.y.p.txt == "l"