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

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

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

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

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

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

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

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

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

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

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

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

j.r = d
j.s = d
j.o = c
k.u = c
k.q = d
k.o = m
k.s = h
k.w = j
m.z = b
m.w = f
m.u = k
m.x = n
c.q = d
c.w = j
b.x = j
b.q = c
b.z = m
h.x = j
h.q = g
h.z = d
n.x = j
n.q = c
n.z = m
g.q = m
g.w = j
d.z = n
d.w = k
d.u = k
d.x = h
f.u = g
f.q = m
f.o = d
f.s = b
f.w = j
assert m.w.s.x.s.txt == "d"