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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

h = A("h")
k = B("k")
l = C("l")
n = D("n")
b = E("b")
j = D("j")

h.s = b
k.v = l
k.x = j
k.q = h
l.t = k
l.w = k
n.t = h
b.z = n
b.y = l
j.t = h
assert l.w.q.s.z.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

h = A("h")
k = B("k")
l = C("l")
n = D("n")
b = E("b")
j = D("j")

h.s = b
k.v = l
k.x = j
k.q = h
l.t = k
l.w = k
n.t = h
b.z = n
b.y = l
j.t = h
assert l.w.q.s.z.t.s.txt == "b"