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

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

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

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

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

l = A("l")
i = B("i")
e = C("e")
m = D("m")
a = E("a")
n = E("n")
c = C("c")
j = A("j")
g = B("g")
b = D("b")

l.o = n
l.v = e
i.y = a
e.r = c
e.o = c
e.w = l
e.s = m
m.x = e
m.o = n
a.y = b
n.y = m
c.r = e
c.o = e
c.w = j
c.s = m
j.o = a
j.v = e
g.y = a
b.x = e
b.o = a
assert l.v.w.o.y.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: C = None
        self.txt = txt

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

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

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

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

l = A("l")
i = B("i")
e = C("e")
m = D("m")
a = E("a")
n = E("n")
c = C("c")
j = A("j")
g = B("g")
b = D("b")

l.o = n
l.v = e
i.y = a
e.r = c
e.o = c
e.w = l
e.s = m
m.x = e
m.o = n
a.y = b
n.y = m
c.r = e
c.o = e
c.w = j
c.s = m
j.o = a
j.v = e
g.y = a
b.x = e
b.o = a
assert l.v.w.o.y.x.r.txt == "c"