class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.v: E = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: D = None
        self.x: A = None
        self.txt = txt

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

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

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

e.o = c
e.y = d
e.v = i
e.x = k
k.r = e
k.q = i
d.y = e
d.x = e
d.t = j
j.p = d
j.w = e
i.w = j
c.y = e
c.x = e
c.t = j
assert i.w.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.v: E = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: D = None
        self.x: A = None
        self.txt = txt

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

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

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

e.o = c
e.y = d
e.v = i
e.x = k
k.r = e
k.q = i
d.y = e
d.x = e
d.t = j
j.p = d
j.w = e
i.w = j
c.y = e
c.x = e
c.t = j
assert i.w.w.v.txt == "i"