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

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

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

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

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

d = A("d")
m = B("m")
g = C("g")
k = D("k")
n = E("n")
b = C("b")
e = A("e")
j = A("j")

d.v = n
d.s = k
d.q = g
m.o = e
m.s = e
m.r = k
g.v = b
g.x = k
g.y = k
g.w = e
k.v = n
n.y = m
n.z = g
n.s = e
b.v = g
b.x = k
b.y = k
b.w = e
e.v = n
e.s = k
e.q = g
j.v = n
j.s = k
j.q = g
assert n.s.v.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

d = A("d")
m = B("m")
g = C("g")
k = D("k")
n = E("n")
b = C("b")
e = A("e")
j = A("j")

d.v = n
d.s = k
d.q = g
m.o = e
m.s = e
m.r = k
g.v = b
g.x = k
g.y = k
g.w = e
k.v = n
n.y = m
n.z = g
n.s = e
b.v = g
b.x = k
b.y = k
b.w = e
e.v = n
e.s = k
e.q = g
j.v = n
j.s = k
j.q = g
assert n.s.v.y.o.txt == "e"