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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

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

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

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

c = A("c")
l = B("l")
k = C("k")
m = D("m")
n = E("n")
b = A("b")
i = A("i")

c.o = m
c.v = b
l.x = n
l.r = n
l.z = n
l.w = n
k.w = n
k.o = n
m.p = n
n.v = k
b.o = m
b.v = c
i.o = m
i.v = b
assert b.o.p.v.w.v.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

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

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

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

c = A("c")
l = B("l")
k = C("k")
m = D("m")
n = E("n")
b = A("b")
i = A("i")

c.o = m
c.v = b
l.x = n
l.r = n
l.z = n
l.w = n
k.w = n
k.o = n
m.p = n
n.v = k
b.o = m
b.v = c
i.o = m
i.v = b
assert b.o.p.v.w.v.w.v.txt == "k"