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

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

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

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

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

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

i.v = n
n.z = b
l.w = j
l.x = k
b.x = i
b.o = j
j.w = k
j.u = n
k.v = n
e.x = k
e.o = j
assert e.o.u.z.x.v.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

i.v = n
n.z = b
l.w = j
l.x = k
b.x = i
b.o = j
j.w = k
j.u = n
k.v = n
e.x = k
e.o = j
assert e.o.u.z.x.v.z.o.txt == "j"