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

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

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

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

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

a.s = l
a.u = e
a.z = e
a.x = i
h.y = k
h.q = c
e.t = h
e.p = g
e.u = c
e.x = i
l.t = h
l.z = h
l.u = h
l.s = h
d.s = k
d.u = j
d.x = i
d.z = g
g.t = h
g.p = e
g.u = a
g.x = j
i.t = h
i.p = j
i.x = j
i.u = c
c.s = l
c.u = j
c.x = g
c.z = e
k.t = h
k.z = h
k.u = h
k.s = h
j.t = h
j.p = g
j.u = c
j.x = e
assert j.x.p.x.p.t.y.u.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

a.s = l
a.u = e
a.z = e
a.x = i
h.y = k
h.q = c
e.t = h
e.p = g
e.u = c
e.x = i
l.t = h
l.z = h
l.u = h
l.s = h
d.s = k
d.u = j
d.x = i
d.z = g
g.t = h
g.p = e
g.u = a
g.x = j
i.t = h
i.p = j
i.x = j
i.u = c
c.s = l
c.u = j
c.x = g
c.z = e
k.t = h
k.z = h
k.u = h
k.s = h
j.t = h
j.p = g
j.u = c
j.x = e
assert j.x.p.x.p.t.y.u.y.z.txt == "h"