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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: E = None
        self.o: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: E = None
        self.o: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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