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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: B = None
        self.x: B = None
        self.o: B = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: B = None
        self.x: B = None
        self.o: B = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

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

n.w = d
n.u = m
n.p = f
j.r = f
j.q = f
j.x = h
j.o = m
j.u = d
h.z = j
h.y = j
h.x = j
h.o = j
h.t = j
d.w = j
f.t = j
f.w = h
f.v = c
f.p = l
b.w = d
b.u = m
b.p = i
c.z = j
c.y = j
c.x = j
c.o = j
c.t = j
l.t = j
l.w = h
l.v = c
l.p = f
i.t = j
i.w = c
i.v = h
i.p = f
m.w = d
m.u = b
m.p = f
assert f.v.y.u.w.txt == "j"