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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: E = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: E = None
        self.r: D = None
        self.txt = txt

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

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

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

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

h.w = a
h.p = c
h.r = n
h.q = f
m.w = c
m.q = c
m.r = a
f.y = n
f.w = j
f.v = c
f.u = a
n.p = c
n.s = c
n.y = a
n.w = b
c.v = i
c.y = a
c.o = b
a.p = c
a.s = c
a.y = n
a.w = b
j.w = n
j.p = c
j.r = a
j.q = f
i.w = c
i.q = c
i.r = n
b.w = c
b.q = c
b.r = a
assert j.p.y.s.v.r.w.r.txt == "a"