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

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

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

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

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

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

a.v = g
a.u = e
a.q = m
d.x = e
h.o = g
h.p = g
h.z = m
g.y = e
g.w = e
g.z = n
g.u = j
e.v = j
e.o = a
e.y = c
j.x = e
m.v = g
m.u = e
m.q = a
c.o = g
c.p = g
c.z = m
l.o = g
l.p = g
l.z = m
n.o = g
n.p = g
n.z = m
assert m.q.u.v.x.v.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

a.v = g
a.u = e
a.q = m
d.x = e
h.o = g
h.p = g
h.z = m
g.y = e
g.w = e
g.z = n
g.u = j
e.v = j
e.o = a
e.y = c
j.x = e
m.v = g
m.u = e
m.q = a
c.o = g
c.p = g
c.z = m
l.o = g
l.p = g
l.z = m
n.o = g
n.p = g
n.z = m
assert m.q.u.v.x.v.x.v.txt == "j"