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

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

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

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

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

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

h.x = e
k.o = e
k.q = f
l.z = k
l.x = h
e.z = k
e.s = j
f.v = e
f.y = j
f.t = k
g.z = k
g.x = h
n.z = k
n.x = j
j.x = e
d.z = k
d.x = h
assert g.x.x.z.o.s.x.z.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

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

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

h.x = e
k.o = e
k.q = f
l.z = k
l.x = h
e.z = k
e.s = j
f.v = e
f.y = j
f.t = k
g.z = k
g.x = h
n.z = k
n.x = j
j.x = e
d.z = k
d.x = h
assert g.x.x.z.o.s.x.z.q.v.txt == "e"