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

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

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

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

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

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

n.y = a
n.r = g
g.y = n
g.z = a
g.w = c
b.y = l
b.v = n
b.t = n
b.o = d
d.o = l
d.r = e
d.t = g
e.r = g
a.r = g
c.y = e
c.r = g
m.o = d
m.r = a
m.t = g
l.o = m
l.r = e
l.t = g
j.y = d
j.o = d
j.v = c
j.t = c
assert e.r.w.r.w.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

n.y = a
n.r = g
g.y = n
g.z = a
g.w = c
b.y = l
b.v = n
b.t = n
b.o = d
d.o = l
d.r = e
d.t = g
e.r = g
a.r = g
c.y = e
c.r = g
m.o = d
m.r = a
m.t = g
l.o = m
l.r = e
l.t = g
j.y = d
j.o = d
j.v = c
j.t = c
assert e.r.w.r.w.r.y.txt == "n"