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

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

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

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

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

b = A("b")
k = B("k")
h = C("h")
a = D("a")
m = E("m")
f = E("f")
j = E("j")
e = C("e")

b.u = j
k.x = b
k.z = b
k.y = m
h.w = b
h.s = a
a.x = e
a.s = k
a.v = k
a.w = b
a.z = m
m.y = e
m.u = h
m.p = j
f.y = h
f.u = e
f.p = j
j.y = e
j.u = e
j.p = m
e.w = b
e.s = a
assert h.s.v.y.p.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

b = A("b")
k = B("k")
h = C("h")
a = D("a")
m = E("m")
f = E("f")
j = E("j")
e = C("e")

b.u = j
k.x = b
k.z = b
k.y = m
h.w = b
h.s = a
a.x = e
a.s = k
a.v = k
a.w = b
a.z = m
m.y = e
m.u = h
m.p = j
f.y = h
f.u = e
f.p = j
j.y = e
j.u = e
j.p = m
e.w = b
e.s = a
assert h.s.v.y.p.p.u.txt == "h"