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

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

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

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

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

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

b.v = h
b.q = h
b.u = j
b.r = m
m.w = j
m.z = d
h.u = b
h.x = d
n.y = m
n.v = m
n.z = h
c.q = h
c.t = m
c.u = m
c.r = g
i.y = m
i.v = m
i.z = h
d.q = h
d.t = m
d.u = m
d.r = j
j.v = h
j.q = h
j.u = b
j.r = m
g.v = h
g.q = h
g.u = j
g.r = m
k.q = h
k.t = m
k.u = m
k.r = g
assert n.z.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: C = None
        self.u: A = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

b.v = h
b.q = h
b.u = j
b.r = m
m.w = j
m.z = d
h.u = b
h.x = d
n.y = m
n.v = m
n.z = h
c.q = h
c.t = m
c.u = m
c.r = g
i.y = m
i.v = m
i.z = h
d.q = h
d.t = m
d.u = m
d.r = j
j.v = h
j.q = h
j.u = b
j.r = m
g.v = h
g.q = h
g.u = j
g.r = m
k.q = h
k.t = m
k.u = m
k.r = g
assert n.z.x.r.txt == "j"