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

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

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

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

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

h = A("h")
l = B("l")
k = C("k")
n = D("n")
g = E("g")
d = D("d")
a = D("a")
b = E("b")
i = A("i")
j = C("j")

h.x = b
h.v = j
l.v = b
l.u = h
k.z = l
k.r = j
k.w = g
n.w = h
n.q = a
n.s = l
n.o = g
g.o = i
d.w = h
d.q = a
d.s = l
d.o = g
a.w = i
a.q = n
a.s = l
a.o = b
b.o = h
i.x = b
i.v = j
j.z = l
j.r = k
j.w = b
assert k.w.o.x.o.v.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: C = None
        self.txt = txt

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

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

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

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

h = A("h")
l = B("l")
k = C("k")
n = D("n")
g = E("g")
d = D("d")
a = D("a")
b = E("b")
i = A("i")
j = C("j")

h.x = b
h.v = j
l.v = b
l.u = h
k.z = l
k.r = j
k.w = g
n.w = h
n.q = a
n.s = l
n.o = g
g.o = i
d.w = h
d.q = a
d.s = l
d.o = g
a.w = i
a.q = n
a.s = l
a.o = b
b.o = h
i.x = b
i.v = j
j.z = l
j.r = k
j.w = b
assert k.w.o.x.o.v.w.o.txt == "h"