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

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

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

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

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

c = A("c")
h = B("h")
i = C("i")
e = D("e")
m = E("m")
l = D("l")
n = A("n")
a = D("a")
j = B("j")

c.x = l
c.w = i
c.v = i
c.y = h
c.u = h
h.r = j
h.u = j
h.q = i
i.u = a
e.y = m
e.u = l
e.r = n
m.r = h
l.y = m
l.u = e
l.r = n
n.x = a
n.w = i
n.v = i
n.y = j
n.u = h
a.y = m
a.u = e
a.r = n
j.r = h
j.u = h
j.q = i
assert m.r.u.q.u.u.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.y: B = None
        self.v: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

c = A("c")
h = B("h")
i = C("i")
e = D("e")
m = E("m")
l = D("l")
n = A("n")
a = D("a")
j = B("j")

c.x = l
c.w = i
c.v = i
c.y = h
c.u = h
h.r = j
h.u = j
h.q = i
i.u = a
e.y = m
e.u = l
e.r = n
m.r = h
l.y = m
l.u = e
l.r = n
n.x = a
n.w = i
n.v = i
n.y = j
n.u = h
a.y = m
a.u = e
a.r = n
j.r = h
j.u = h
j.q = i
assert m.r.u.q.u.u.r.v.txt == "i"