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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.y: C = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: A = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

i.r = l
i.z = e
i.v = m
i.s = m
i.t = g
f.v = m
f.z = m
f.y = m
f.r = i
f.t = i
m.p = d
d.u = m
d.q = m
d.t = i
n.v = h
h.r = l
h.z = g
h.t = g
h.v = m
h.s = m
l.u = m
l.q = m
l.t = h
g.v = m
g.z = m
g.y = m
g.r = i
g.t = h
e.v = m
e.z = m
e.y = m
e.r = i
e.t = i
j.v = h
assert n.v.v.p.t.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.v: C = None
        self.s: C = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.y: C = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: A = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

i.r = l
i.z = e
i.v = m
i.s = m
i.t = g
f.v = m
f.z = m
f.y = m
f.r = i
f.t = i
m.p = d
d.u = m
d.q = m
d.t = i
n.v = h
h.r = l
h.z = g
h.t = g
h.v = m
h.s = m
l.u = m
l.q = m
l.t = h
g.v = m
g.z = m
g.y = m
g.r = i
g.t = h
e.v = m
e.z = m
e.y = m
e.r = i
e.t = i
j.v = h
assert n.v.v.p.t.z.y.txt == "m"