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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: A = None
        self.s: D = None
        self.x: E = None
        self.v: A = None
        self.txt = txt

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

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

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

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

c.w = n
c.x = h
j.u = l
j.p = c
j.s = k
j.x = e
j.v = h
d.x = k
d.u = k
k.o = j
l.v = n
l.y = d
e.v = n
e.y = d
h.w = j
h.x = c
n.u = e
n.p = h
n.v = h
n.s = k
n.x = l
assert j.v.x.w.s.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: A = None
        self.s: D = None
        self.x: E = None
        self.v: A = None
        self.txt = txt

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

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

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

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

c.w = n
c.x = h
j.u = l
j.p = c
j.s = k
j.x = e
j.v = h
d.x = k
d.u = k
k.o = j
l.v = n
l.y = d
e.v = n
e.y = d
h.w = j
h.x = c
n.u = e
n.p = h
n.v = h
n.s = k
n.x = l
assert j.v.x.w.s.o.x.txt == "e"