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

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

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

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

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

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

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

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

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

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

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

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

j.o = l
c.s = i
c.y = n
c.r = h
l.v = i
l.z = j
i.z = h
i.o = h
i.v = n
i.x = n
i.w = j
h.z = c
h.r = l
h.w = i
h.t = n
h.p = e
n.o = l
e.o = l
assert l.v.o.w.v.o.v.txt == "i"