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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: A = None
        self.t: A = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

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

j.z = m
j.v = m
j.s = f
j.x = f
j.w = k
f.p = a
a.p = g
m.w = k
k.s = e
k.w = j
k.t = j
k.q = j
k.u = a
g.p = a
e.s = k
e.w = j
e.t = j
e.q = j
e.u = a
assert j.w.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.x: B = None
        self.v: D = None
        self.w: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: A = None
        self.t: A = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

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

j.z = m
j.v = m
j.s = f
j.x = f
j.w = k
f.p = a
a.p = g
m.w = k
k.s = e
k.w = j
k.t = j
k.q = j
k.u = a
g.p = a
e.s = k
e.w = j
e.t = j
e.q = j
e.u = a
assert j.w.u.p.txt == "g"