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

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

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

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

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

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

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

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

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

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

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

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

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