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

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

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

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

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

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

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

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

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

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

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

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

c.v = i
c.w = b
c.s = a
c.r = d
g.y = c
g.z = l
g.x = i
m.t = l
m.u = a
m.z = g
m.o = g
m.r = c
a.v = n
a.u = c
a.y = l
b.u = m
b.p = h
b.x = h
b.z = n
n.t = g
n.u = h
n.z = d
n.r = c
n.o = l
d.y = c
d.z = l
d.x = b
l.y = c
l.z = d
l.x = i
i.u = n
i.p = a
i.x = a
i.z = m
h.v = m
h.u = c
h.y = d
assert n.r.r.z.txt == "l"