class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: B = None
        self.u: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: B = None
        self.x: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: B = None
        self.x: D = None
        self.r: B = None
        self.txt = txt

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

h.s = k
h.q = a
h.u = a
a.p = i
a.w = h
a.z = k
a.x = l
k.x = l
i.u = a
i.r = a
i.s = l
i.t = h
l.v = k
l.s = a
l.r = a
l.x = i
assert i.r.p.u.x.x.txt == "i"