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

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

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

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

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

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

g.q = j
g.y = n
g.x = a
g.z = l
j.v = b
j.o = m
j.s = c
m.x = a
m.u = a
m.w = a
m.p = j
a.p = j
h.w = a
h.v = b
b.q = j
b.y = n
b.x = a
b.z = h
c.x = a
c.u = a
c.w = a
c.p = j
l.w = a
l.v = g
f.w = a
f.v = b
n.w = a
n.v = b
assert m.w.p.s.w.p.s.w.p.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

g.q = j
g.y = n
g.x = a
g.z = l
j.v = b
j.o = m
j.s = c
m.x = a
m.u = a
m.w = a
m.p = j
a.p = j
h.w = a
h.v = b
b.q = j
b.y = n
b.x = a
b.z = h
c.x = a
c.u = a
c.w = a
c.p = j
l.w = a
l.v = g
f.w = a
f.v = b
n.w = a
n.v = b
assert m.w.p.s.w.p.s.w.p.s.x.txt == "a"