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

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

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

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

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

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

h.v = d
h.x = n
h.s = e
c.y = j
c.s = k
c.w = d
k.v = g
k.t = d
d.s = g
d.w = b
d.t = b
d.o = b
j.v = d
j.u = g
b.y = j
b.s = k
b.w = d
g.v = d
g.u = j
n.v = d
n.x = h
n.s = e
e.v = j
e.t = d
assert d.s.v.s.u.u.u.v.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

h.v = d
h.x = n
h.s = e
c.y = j
c.s = k
c.w = d
k.v = g
k.t = d
d.s = g
d.w = b
d.t = b
d.o = b
j.v = d
j.u = g
b.y = j
b.s = k
b.w = d
g.v = d
g.u = j
n.v = d
n.x = h
n.s = e
e.v = j
e.t = d
assert d.s.v.s.u.u.u.v.o.s.txt == "k"