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

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

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

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

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

m = A("m")
k = B("k")
d = C("d")
j = D("j")
a = E("a")
h = A("h")

m.z = h
m.v = h
m.p = k
k.w = d
k.o = d
k.x = j
k.s = a
d.q = m
d.x = k
d.w = h
d.s = j
j.u = k
a.w = k
a.s = j
h.z = m
h.v = m
h.p = k
assert j.u.o.w.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

m = A("m")
k = B("k")
d = C("d")
j = D("j")
a = E("a")
h = A("h")

m.z = h
m.v = h
m.p = k
k.w = d
k.o = d
k.x = j
k.s = a
d.q = m
d.x = k
d.w = h
d.s = j
j.u = k
a.w = k
a.s = j
h.z = m
h.v = m
h.p = k
assert j.u.o.w.p.x.txt == "j"