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

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

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

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

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

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

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

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

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

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

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

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

n.o = m
n.q = l
n.z = c
n.w = h
l.o = j
j.v = l
j.t = c
e.y = i
e.r = n
e.w = c
c.w = m
c.t = n
m.y = i
m.r = n
m.w = c
h.o = i
i.v = h
i.t = c
assert l.o.t.t.o.w.t.txt == "n"