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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

j = A("j")
m = B("m")
e = C("e")
f = D("f")
a = E("a")
g = A("g")
n = A("n")
l = D("l")
c = B("c")
d = B("d")

j.p = a
j.z = e
j.o = e
j.w = n
m.v = e
m.s = d
e.r = c
e.s = f
e.o = l
f.q = a
f.p = e
a.q = l
a.t = e
a.x = e
a.v = m
g.p = a
g.z = e
g.o = e
g.w = j
n.p = a
n.z = e
n.o = e
n.w = j
l.q = a
l.p = e
c.v = e
c.s = d
d.v = e
d.s = c
assert j.w.p.x.s.p.o.p.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

j = A("j")
m = B("m")
e = C("e")
f = D("f")
a = E("a")
g = A("g")
n = A("n")
l = D("l")
c = B("c")
d = B("d")

j.p = a
j.z = e
j.o = e
j.w = n
m.v = e
m.s = d
e.r = c
e.s = f
e.o = l
f.q = a
f.p = e
a.q = l
a.t = e
a.x = e
a.v = m
g.p = a
g.z = e
g.o = e
g.w = j
n.p = a
n.z = e
n.o = e
n.w = j
l.q = a
l.p = e
c.v = e
c.s = d
d.v = e
d.s = c
assert j.w.p.x.s.p.o.p.o.q.txt == "a"