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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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

e.u = k
d.v = e
d.x = n
d.s = i
d.q = i
i.o = n
i.w = k
i.v = e
n.o = d
n.z = d
n.p = d
n.u = d
k.x = i
k.u = n
assert n.o.v.u.x.txt == "i"