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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.q: D = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: C = None
        self.v: B = None
        self.z: C = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.q: D = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: C = None
        self.v: B = None
        self.z: C = None
        self.x: D = None
        self.txt = txt

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

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

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

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