class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.t: G = None
        self.y: H = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: A = None
        self.t: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: E = None
        self.s: F = None
        self.r: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: A = None
        self.t: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: E = None
        self.s: F = None
        self.r: B = None
        self.txt = txt

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

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