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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.w: D = None
        self.q: B = None
        self.p: A = None
        self.txt = txt

a = A("a")
h = B("h")
k = C("k")
j = D("j")
l = E("l")
e = B("e")

a.w = l
a.y = l
a.s = j
h.z = k
h.t = a
k.w = j
k.t = j
j.r = a
j.t = a
l.v = a
l.y = a
l.p = a
l.w = j
l.q = h
e.z = k
e.t = a
assert e.t.w.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: E = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.w: D = None
        self.q: B = None
        self.p: A = None
        self.txt = txt

a = A("a")
h = B("h")
k = C("k")
j = D("j")
l = E("l")
e = B("e")

a.w = l
a.y = l
a.s = j
h.z = k
h.t = a
k.w = j
k.t = j
j.r = a
j.t = a
l.v = a
l.y = a
l.p = a
l.w = j
l.q = h
e.z = k
e.t = a
assert e.t.w.y.s.txt == "j"