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

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

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

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

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

j = A("j")
d = B("d")
m = C("m")
k = D("k")
e = E("e")
i = C("i")
f = A("f")
l = B("l")
g = E("g")

j.u = f
j.x = f
j.w = e
d.o = k
m.q = j
m.s = k
m.t = l
m.p = f
k.q = j
k.t = m
e.x = g
e.p = g
e.v = g
e.s = g
e.u = f
i.q = j
i.s = k
i.t = d
i.p = f
f.u = j
f.x = j
f.w = g
l.o = k
g.x = e
g.p = e
g.v = e
g.s = e
g.u = j
assert g.x.u.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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

j = A("j")
d = B("d")
m = C("m")
k = D("k")
e = E("e")
i = C("i")
f = A("f")
l = B("l")
g = E("g")

j.u = f
j.x = f
j.w = e
d.o = k
m.q = j
m.s = k
m.t = l
m.p = f
k.q = j
k.t = m
e.x = g
e.p = g
e.v = g
e.s = g
e.u = f
i.q = j
i.s = k
i.t = d
i.p = f
f.u = j
f.x = j
f.w = g
l.o = k
g.x = e
g.p = e
g.v = e
g.s = e
g.u = j
assert g.x.u.w.p.txt == "e"