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

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

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

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

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

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

h.r = k
h.x = l
h.q = b
b.s = e
b.w = k
b.p = a
k.v = e
k.o = e
k.y = b
k.u = l
k.t = l
e.t = l
e.q = l
l.y = h
l.t = h
a.v = e
a.o = e
a.y = b
a.u = l
a.t = l
assert e.q.t.q.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

h.r = k
h.x = l
h.q = b
b.s = e
b.w = k
b.p = a
k.v = e
k.o = e
k.y = b
k.u = l
k.t = l
e.t = l
e.q = l
l.y = h
l.t = h
a.v = e
a.o = e
a.y = b
a.u = l
a.t = l
assert e.q.t.q.s.t.txt == "l"