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

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

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

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

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

i = A("i")
n = B("n")
k = C("k")
l = D("l")
e = E("e")

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

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

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

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

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

i = A("i")
n = B("n")
k = C("k")
l = D("l")
e = E("e")

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