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

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

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

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

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

d = A("d")
h = B("h")
l = C("l")
j = D("j")
i = E("i")

d.s = i
d.w = h
h.o = i
h.v = i
h.t = d
l.v = i
l.q = d
j.s = i
i.q = l
assert d.s.q.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: B = None
        self.txt = txt

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

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

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

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

d = A("d")
h = B("h")
l = C("l")
j = D("j")
i = E("i")

d.s = i
d.w = h
h.o = i
h.v = i
h.t = d
l.v = i
l.q = d
j.s = i
i.q = l
assert d.s.q.q.w.txt == "h"