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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: H = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: G = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

a = A("a")
l = B("l")
e = C("e")
i = D("i")
h = E("h")
m = F("m")
d = G("d")
j = H("j")
k = B("k")
n = A("n")

a.r = n
a.z = i
a.s = l
a.t = d
l.t = d
l.x = a
e.y = a
e.o = j
e.t = i
i.u = j
i.w = h
h.q = j
h.p = d
h.s = m
m.z = d
d.v = h
j.w = n
k.t = d
k.x = n
n.r = a
n.z = i
n.s = k
n.t = d
assert e.y.s.t.v.s.z.v.p.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.s: B = None
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: H = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: G = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

a = A("a")
l = B("l")
e = C("e")
i = D("i")
h = E("h")
m = F("m")
d = G("d")
j = H("j")
k = B("k")
n = A("n")

a.r = n
a.z = i
a.s = l
a.t = d
l.t = d
l.x = a
e.y = a
e.o = j
e.t = i
i.u = j
i.w = h
h.q = j
h.p = d
h.s = m
m.z = d
d.v = h
j.w = n
k.t = d
k.x = n
n.r = a
n.z = i
n.s = k
n.t = d
assert e.y.s.t.v.s.z.v.p.v.q.txt == "j"