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

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

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

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

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

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

i.v = c
i.w = l
j.r = c
l.q = j
l.r = j
l.o = i
l.x = e
e.v = n
e.w = c
e.z = j
e.y = j
n.v = i
c.v = n
c.w = e
c.z = j
c.y = j
assert i.w.o.w.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

i.v = c
i.w = l
j.r = c
l.q = j
l.r = j
l.o = i
l.x = e
e.v = n
e.w = c
e.z = j
e.y = j
n.v = i
c.v = n
c.w = e
c.z = j
c.y = j
assert i.w.o.w.o.v.txt == "c"