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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.p: A = None
        self.x: C = None
        self.txt = txt

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

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

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

c = A("c")
l = B("l")
i = C("i")
f = D("f")
h = E("h")
n = B("n")
d = C("d")
g = D("g")

c.x = n
l.y = h
l.o = c
l.p = c
l.x = i
i.z = h
i.s = h
f.y = g
f.x = g
f.o = l
f.v = n
f.u = n
h.v = d
n.y = h
n.o = c
n.p = c
n.x = i
d.z = h
d.s = h
g.y = f
g.x = f
g.o = n
g.u = n
g.v = l
assert l.x.z.v.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.p: A = None
        self.x: C = None
        self.txt = txt

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

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

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

c = A("c")
l = B("l")
i = C("i")
f = D("f")
h = E("h")
n = B("n")
d = C("d")
g = D("g")

c.x = n
l.y = h
l.o = c
l.p = c
l.x = i
i.z = h
i.s = h
f.y = g
f.x = g
f.o = l
f.v = n
f.u = n
h.v = d
n.y = h
n.o = c
n.p = c
n.x = i
d.z = h
d.s = h
g.y = f
g.x = f
g.o = n
g.u = n
g.v = l
assert l.x.z.v.s.v.s.txt == "h"