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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.s: A = None
        self.z: C = None
        self.txt = txt

j = A("j")
l = B("l")
b = C("b")
a = D("a")
g = E("g")
k = C("k")

j.v = g
j.u = a
j.t = a
j.w = l
l.x = k
l.v = j
b.q = a
b.v = k
a.v = g
a.u = j
g.w = a
g.x = j
g.s = j
g.z = b
k.q = a
k.v = b
assert l.x.q.v.w.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: D = None
        self.w: B = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.s: A = None
        self.z: C = None
        self.txt = txt

j = A("j")
l = B("l")
b = C("b")
a = D("a")
g = E("g")
k = C("k")

j.v = g
j.u = a
j.t = a
j.w = l
l.x = k
l.v = j
b.q = a
b.v = k
a.v = g
a.u = j
g.w = a
g.x = j
g.s = j
g.z = b
k.q = a
k.v = b
assert l.x.q.v.w.v.w.txt == "a"